From 5b4553d6a5fe5f0ec42ca8e6033d70008543f396 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 10 Oct 2017 13:07:03 -0700 Subject: [PATCH 01/54] Updated vfs --- Jakefile.js | 4 +- src/harness/collections.ts | 213 ++++ src/harness/harness.ts | 6 +- src/harness/harnessLanguageService.ts | 26 +- src/harness/tsconfig.json | 3 + .../unittests/configurationExtension.ts | 2 +- src/harness/unittests/matchFiles.ts | 2 +- src/harness/vfs.ts | 1073 +++++++++++++++++ src/harness/virtualFileSystem.ts | 223 ---- src/harness/vpath.ts | 161 +++ tests/cases/fourslash/findAllRefsForModule.ts | 2 +- 11 files changed, 1473 insertions(+), 242 deletions(-) create mode 100644 src/harness/collections.ts create mode 100644 src/harness/vfs.ts delete mode 100644 src/harness/virtualFileSystem.ts create mode 100644 src/harness/vpath.ts diff --git a/Jakefile.js b/Jakefile.js index 0b3659e205116..49641cab710ab 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -93,7 +93,9 @@ var typesMapOutputPath = path.join(builtLocalDirectory, 'typesMap.json'); var harnessCoreSources = [ "harness.ts", - "virtualFileSystem.ts", + "collections.ts", + "vpath.ts", + "vfs.ts", "virtualFileSystemWithWatch.ts", "sourceMapRecorder.ts", "harnessLanguageService.ts", diff --git a/src/harness/collections.ts b/src/harness/collections.ts new file mode 100644 index 0000000000000..e0f5e9a2aea52 --- /dev/null +++ b/src/harness/collections.ts @@ -0,0 +1,213 @@ +/// +namespace Collections { + import compareValues = ts.compareValues; + import binarySearch = ts.binarySearch; + import removeAt = ts.orderedRemoveItemAt; + + const caseInsensitiveComparisonCollator = typeof Intl === "object" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined; + const caseSensitiveComparisonCollator = typeof Intl === "object" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "variant" }) : undefined; + + export function compareStrings(a: string | undefined, b: string | undefined, ignoreCase?: boolean) { + if (a === b) return 0; + if (a === undefined) return -1; + if (b === undefined) return +1; + const collator = ignoreCase ? caseInsensitiveComparisonCollator : caseSensitiveComparisonCollator; + if (collator) { + return collator.compare(a, b); + } + else if (ignoreCase) { + a = a.toUpperCase(); + b = b.toUpperCase(); + } + return a < b ? -1 : a > b ? +1 : 0; + } + + export namespace compareStrings { + export function caseSensitive(a: string | undefined, b: string | undefined) { + return compareStrings(a, b, /*ignoreCase*/ false); + } + + export function caseInsensitive(a: string | undefined, b: string | undefined) { + return compareStrings(a, b, /*ignoreCase*/ true); + } + } + + function insertAt(array: T[], index: number, value: T) { + if (index === 0) { + array.unshift(value); + } + else if (index === array.length) { + array.push(value); + } + else { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; + } + } + + /** + * A collection of key/value pairs sorted by key. + */ + export class KeyedCollection { + private _comparer: (a: K, b: K) => number; + private _keys: K[] = []; + private _values: V[] = []; + private _order: number[] = []; + private _version = 0; + private _copyOnWrite = false; + + constructor(comparer: (a: K, b: K) => number = compareValues) { + this._comparer = comparer; + } + + public get size() { + return this._keys.length; + } + + public has(key: K) { + return binarySearch(this._keys, key, this._comparer) >= 0; + } + + public get(key: K) { + const index = binarySearch(this._keys, key, this._comparer); + return index >= 0 ? this._values[index] : undefined; + } + + public set(key: K, value: V) { + const index = binarySearch(this._keys, key, this._comparer); + if (index >= 0) { + this._values[index] = value; + } + else { + this.writePreamble(); + insertAt(this._keys, ~index, key); + insertAt(this._values, ~index, value); + insertAt(this._order, ~index, this._version); + this._version++; + } + return this; + } + + public delete(key: K) { + const index = binarySearch(this._keys, key, this._comparer); + if (index >= 0) { + this.writePreamble(); + removeAt(this._keys, index); + removeAt(this._values, index); + removeAt(this._order, index); + this._version++; + return true; + } + return false; + } + + public clear() { + if (this.size > 0) { + this.writePreamble(); + this._keys.length = 0; + this._values.length = 0; + this._order.length = 0; + this._version = 0; + } + } + + public forEach(callback: (value: V, key: K, collection: this) => void) { + const keys = this._keys; + const values = this._values; + const order = this.getInsertionOrder(); + const version = this._version; + this._copyOnWrite = true; + for (let i = 0; i < order.length; i++) { + callback(values[order[i]], keys[order[i]], this); + } + if (version === this._version) { + this._copyOnWrite = false; + } + } + + private writePreamble() { + if (this._copyOnWrite) { + this._keys = this._keys.slice(); + this._values = this._values.slice(); + this._order = this._order.slice(); + this._copyOnWrite = false; + } + } + + private getInsertionOrder() { + return this._order + .map((_, i) => i) + .sort((x, y) => compareValues(this._order[x], this._order[y])); + } + } + + const undefinedSentinel = {}; + + /** + * A collection of metadata that supports inheritance. + */ + export class Metadata { + private _parent: Metadata | undefined; + private _map: { [key: string]: any }; + private _version = 0; + private _size = -1; + private _parentVersion: number | undefined; + + constructor(parent?: Metadata) { + this._parent = parent; + this._map = Object.create(parent ? parent._map : null); // tslint:disable-line:no-null-keyword + } + + public get size(): number { + if (this._size === -1 || (this._parent && this._parent._version !== this._parentVersion)) { + let size = 0; + for (const _ in this._map) size++; + this._size = size; + if (this._parent) { + this._parentVersion = this._parent._version; + } + } + return this._size; + } + + public has(key: string): boolean { + return this._map[key] !== undefined; + } + + public get(key: string): any { + const value = this._map[key]; + return value === undefinedSentinel ? undefined : value; + } + + public set(key: string, value: any): this { + this._map[key] = value === undefined ? undefinedSentinel : value; + this._size = -1; + this._version++; + return this; + } + + public delete(key: string): boolean { + if (this._map[key] !== undefined) { + delete this._map[key]; + this._size = -1; + this._version++; + return true; + } + return false; + } + + public clear(): void { + this._map = Object.create(this._parent ? this._parent._map : null); // tslint:disable-line:no-null-keyword + this._size = -1; + this._version++; + } + + public forEach(callback: (value: any, key: string, map: this) => void) { + for (const key in this._map) { + callback(this._map[key], key, this); + } + } + } +} \ No newline at end of file diff --git a/src/harness/harness.ts b/src/harness/harness.ts index a0fb88213edde..f24ee950d7d4b 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -20,7 +20,7 @@ /// /// /// -/// +/// /// /// /// @@ -743,8 +743,8 @@ namespace Harness { fs.addFile(file); } return ts.matchFiles(path, extension, exclude, include, useCaseSensitiveFileNames(), getCurrentDirectory(), depth, path => { - const entry = fs.traversePath(path); - if (entry && entry.isDirectory()) { + const entry = fs.getEntry(path); + if (entry instanceof Utils.VirtualDirectory) { const directory = entry; return { files: ts.map(directory.getFiles(), f => f.name), diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index ad79c96d833f8..9e353a1435133 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -123,7 +123,7 @@ namespace Harness.LanguageService { } export class LanguageServiceAdapterHost { - protected virtualFileSystem: Utils.VirtualFileSystem = new Utils.VirtualFileSystem(virtualFileSystemRoot, /*useCaseSensitiveFilenames*/false); + protected virtualFileSystem: Utils.VirtualFileSystem = new Utils.VirtualFileSystem(virtualFileSystemRoot, /*useCaseSensitiveFilenames*/ false); constructor(protected cancellationToken = DefaultHostCancellationToken.Instance, protected settings = ts.getDefaultCompilerOptions()) { @@ -135,9 +135,9 @@ namespace Harness.LanguageService { public getFilenames(): string[] { const fileNames: string[] = []; - for (const virtualEntry of this.virtualFileSystem.getAllFileEntries()) { - const scriptInfo = virtualEntry.content; - if (scriptInfo.isRootFile) { + for (const virtualEntry of this.virtualFileSystem.getFiles({ recursive: true })) { + const scriptInfo = virtualEntry.metadata.get("scriptInfo"); + if (scriptInfo && scriptInfo.isRootFile) { // only include root files here // usually it means that we won't include lib.d.ts in the list of root files so it won't mess the computation of compilation root dir. fileNames.push(scriptInfo.fileName); @@ -147,18 +147,20 @@ namespace Harness.LanguageService { } public getScriptInfo(fileName: string): ScriptInfo { - const fileEntry = this.virtualFileSystem.traversePath(fileName); - return fileEntry && fileEntry.isFile() ? (fileEntry).content : undefined; + const fileEntry = this.virtualFileSystem.getFile(fileName); + return fileEntry ? fileEntry.metadata.get("scriptInfo") : undefined; } public addScript(fileName: string, content: string, isRootFile: boolean): void { - this.virtualFileSystem.addFile(fileName, new ScriptInfo(fileName, content, isRootFile)); + this.virtualFileSystem.addFile(fileName, content, { overwrite: true }).metadata.set("scriptInfo", new ScriptInfo(fileName, content, isRootFile)); } public editScript(fileName: string, start: number, end: number, newText: string) { - const script = this.getScriptInfo(fileName); - if (script !== undefined) { + const file = this.virtualFileSystem.getFile(fileName); + const script = file && file.metadata.get("scriptInfo") as ScriptInfo; + if (script) { script.editContent(start, end, newText); + file.setContent(script.content); return; } @@ -185,9 +187,9 @@ namespace Harness.LanguageService { getCompilationSettings() { return this.settings; } getCancellationToken() { return this.cancellationToken; } getDirectories(path: string): string[] { - const dir = this.virtualFileSystem.traversePath(path); - if (dir && dir.isDirectory()) { - return ts.map((dir).getDirectories(), (d) => ts.combinePaths(path, d.name)); + const dir = this.virtualFileSystem.getDirectory(path); + if (dir) { + return ts.map(dir.getDirectories(), (d) => ts.combinePaths(path, d.name)); } return []; } diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index a0c141f4f1760..2838ba5b0c453 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -97,6 +97,9 @@ "./parallel/host.ts", "./parallel/worker.ts", "runner.ts", + "collections.ts", + "vpath.ts", + "vfs.ts", "virtualFileSystemWithWatch.ts", "../server/protocol.ts", "../server/session.ts", diff --git a/src/harness/unittests/configurationExtension.ts b/src/harness/unittests/configurationExtension.ts index 0032505aba14f..be87b66ca742d 100644 --- a/src/harness/unittests/configurationExtension.ts +++ b/src/harness/unittests/configurationExtension.ts @@ -1,5 +1,5 @@ /// -/// +/// namespace ts { const testContentsJson = createMapFromTemplate({ diff --git a/src/harness/unittests/matchFiles.ts b/src/harness/unittests/matchFiles.ts index f2c2369ef37f4..b56e3a5648bef 100644 --- a/src/harness/unittests/matchFiles.ts +++ b/src/harness/unittests/matchFiles.ts @@ -1,5 +1,5 @@ /// -/// +/// namespace ts { const caseInsensitiveBasePath = "c:/dev/"; diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts new file mode 100644 index 0000000000000..bd33e632d6fa9 --- /dev/null +++ b/src/harness/vfs.ts @@ -0,0 +1,1073 @@ +/// +/// +/// +/// +namespace Utils { + import compareStrings = Collections.compareStrings; + import removeAt = ts.orderedRemoveItemAt; + import KeyedCollection = Collections.KeyedCollection; + import Metadata = Collections.Metadata; + + // import IO = Harness.IO; + + // export interface PathMappings { + // [path: string]: string; + // } + + // export interface FileSystemResolver { + // getEntries(dir: VirtualDirectory): { files: string[], directories: string[] }; + // getContent(file: VirtualFile): string | undefined; + // } + + // function createMapper(ignoreCase: boolean, map: PathMappings | undefined) { + // if (!map) return identity; + // const roots = Object.keys(map); + // const patterns = roots.map(root => createPattern(root, ignoreCase)); + // return function (path: string) { + // for (let i = 0; i < patterns.length; i++) { + // const match = patterns[i].exec(path); + // if (match) { + // const prefix = path.slice(0, match.index); + // const suffix = path.slice(match.index + match[0].length); + // return vpath.combine(prefix, map[roots[i]], suffix); + // } + // } + // return path; + // }; + // } + + // function createPattern(path: string, ignoreCase: boolean) { + // path = vpath.normalizeSlashes(path); + // const components = vpath.parse(path); + // let pattern = ""; + // for (let i = 1; i < components.length; i++) { + // const component = components[i]; + // if (pattern) pattern += "/"; + // pattern += escapeRegExp(component); + // } + // pattern = (components[0] ? "^" + escapeRegExp(components[0]) : "/") + pattern + "(/|$)"; + // return new RegExp(pattern, ignoreCase ? "i" : ""); + // } + + // export function createResolver(io: IO, map?: PathMappings): FileSystemResolver { + // const mapper = createMapper(!io.useCaseSensitiveFileNames(), map); + // return { + // getEntries(dir) { + // return io.getAccessibleFileSystemEntries(mapper(dir.path)); + // }, + // getContent(file) { + // return io.readFile(mapper(file.path)); + // } + // }; + // } + + export type FindAxis = "ancestors" | "ancestors-or-self" | "self" | "descendents-or-self" | "descendents"; + + export abstract class VirtualFileSystemEntry { + private _readonly = false; + private _path: string; + private _metadata: Metadata; + + /** + * Gets the name of this entry. + */ + public readonly name: string; + + constructor(name: string) { + this.name = name; + } + + /** + * Gets the file system to which this entry belongs. + */ + public get fileSystem(): VirtualFileSystem { + return this.parent.fileSystem; + } + + /** + * Gets the container for this entry. + */ + public abstract get parent(): VirtualFileSystemContainer; + + /** + * Gets the entry that this entry shadows. + */ + public abstract get shadowRoot(): VirtualFileSystemEntry | undefined; + + /** + * Gets metadata about this entry. + */ + public get metadata(): Metadata { + return this._metadata || (this._metadata = new Metadata(this.shadowRoot ? this.shadowRoot.metadata : undefined)); + } + + /** + * Gets a value indicating whether this entry is read-only. + */ + public get isReadOnly(): boolean { + return this._readonly; + } + + public get path(): string { + return this._path || (this._path = vpath.combine(this.parent.path, this.name)); + } + + public get relative(): string { + return this.relativeTo(this.fileSystem.currentDirectory); + } + + public get exists(): boolean { + return this.parent.exists + && this.parent.getEntry(this.name) as VirtualFileSystemEntry === this; + } + + public makeReadOnly(): void { + this.makeReadOnlyCore(); + this._readonly = true; + } + + public relativeTo(other: string | VirtualFileSystemEntry) { + if (other) { + const otherPath = typeof other === "string" ? other : other.path; + const ignoreCase = !this.fileSystem.useCaseSensitiveFileNames; + return vpath.relative(otherPath, this.path, ignoreCase); + } + return this.path; + } + + /** + * Creates a file system entry that shadows this file system entry. + * @param parent The container for the shadowed entry. + */ + public abstract shadow(parent: VirtualFileSystemContainer): VirtualFileSystemEntry; + + protected abstract makeReadOnlyCore(): void; + + protected writePreamble(): void { + if (this._readonly) throw new Error("Cannot modify a frozen entry."); + } + + protected shadowPreamble(parent: VirtualFileSystemContainer): void { + if (this.parent !== parent.shadowRoot) throw new Error("Incorrect shadow parent"); + let fileSystem: VirtualFileSystem | undefined = this.fileSystem; + while (fileSystem) { + if (parent.fileSystem === fileSystem) throw new Error("Cannot create shadow for parent in the same file system."); + fileSystem = fileSystem.shadowRoot; + } + } + } + + export abstract class VirtualFileSystemContainer extends VirtualFileSystemEntry { + private _childAddedCallbacks: ((entry: VirtualFile | VirtualDirectory) => void)[]; + private _childRemovedCallbacks: ((entry: VirtualFile | VirtualDirectory) => void)[]; + + public abstract get shadowRoot(): VirtualFileSystemContainer | undefined; + + public addOnChildAdded(callback: (entry: VirtualFile | VirtualDirectory) => void) { + if (!this._childAddedCallbacks) { + this._childAddedCallbacks = [callback]; + } + else if (this._childAddedCallbacks.indexOf(callback) === -1) { + this._childAddedCallbacks.push(callback); + } + } + + public removeOnChildAdded(callback: (entry: VirtualFile | VirtualDirectory) => void) { + if (this._childAddedCallbacks) { + const index = this._childAddedCallbacks.indexOf(callback); + if (index >= 0) removeAt(this._childAddedCallbacks, index); + } + } + + public addOnChildRemoved(callback: (entry: VirtualFile | VirtualDirectory) => void) { + if (!this._childRemovedCallbacks) { + this._childRemovedCallbacks = [callback]; + } + else if (this._childRemovedCallbacks.indexOf(callback) === -1) { + this._childRemovedCallbacks.push(callback); + } + } + + public removeOnChildRemoved(callback: (entry: VirtualFile | VirtualDirectory) => void) { + if (this._childRemovedCallbacks) { + const index = this._childRemovedCallbacks.indexOf(callback); + if (index >= 0) removeAt(this._childRemovedCallbacks, index); + } + } + + public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile[]; + public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory[]; + public getEntries(options?: { recursive?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): (VirtualFile | VirtualDirectory)[]; + public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): (VirtualFile | VirtualDirectory)[] { + const results: (VirtualFile | VirtualDirectory)[] = []; + if (options.recursive) { + this.getOwnEntries().forEach(entry => { + if (entry instanceof VirtualFile) { + if (isMatch(entry, options)) { + results.push(entry); + } + } + else if (entry instanceof VirtualDirectory) { + if (isMatch(entry, options)) { + results.push(entry); + } + for (const child of entry.getEntries(options)) { + results.push(child); + } + } + }); + } + else { + this.getOwnEntries().forEach(entry => { + if (isMatch(entry, options)) { + results.push(entry); + } + }); + } + return results; + } + + public getDirectories(options: { recursive?: boolean, pattern?: RegExp } = {}): VirtualDirectory[] { + return this.getEntries({ ...options, kind: "directory" }); + } + + public getFiles(options: { recursive?: boolean, pattern?: RegExp } = {}): VirtualFile[] { + return this.getEntries({ ...options, kind: "file" }); + } + + public getEntryNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): string[] { + return this.getEntries(options).map(entry => + options && options.qualified ? entry.path : + options && options.recursive ? entry.relativeTo(this) : + entry.name); + } + + public getDirectoryNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp } = {}): string[] { + return this.getEntryNames({ ...options, kind: "directory" }); + } + + public getFileNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp } = {}): string[] { + return this.getEntryNames({ ...options, kind: "file" }); + } + + public abstract getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + public abstract getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; + public abstract getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; + + public getDirectory(path: string, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualDirectory | undefined { + return this.getEntry(path, { ...options, kind: "directory" }); + } + + public getFile(path: string, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualFile | undefined { + return this.getEntry(path, { ...options, kind: "file" }); + } + + public findEntry(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + public findEntry(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; + public findEntry(path: string, axis: FindAxis, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; + public findEntry(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualFile | VirtualDirectory | undefined { + const walkAncestors = axis === "ancestors-or-self" || axis === "ancestors"; + const walkDescendents = axis === "descendents-or-self" || axis === "descendents"; + const walkSelf = axis === "ancestors-or-self" || axis === "self" || axis === "descendents-or-self"; + if (walkSelf) { + const entry = this.getEntry(path, options); + if (entry) return entry; + } + if (walkAncestors) { + const entry = !(this instanceof VirtualFileSystem) && this.parent.findEntry(path, "ancestors-or-self", options); + if (entry) return entry; + } + if (walkDescendents) { + for (const child of this.getDirectories()) { + const entry = child.findEntry(path, "descendents-or-self", options); + if (entry) return entry; + } + } + } + + public findDirectory(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualDirectory | undefined { + return this.findEntry(path, axis, { ...options, kind: "directory" }); + } + + public findFile(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualFile | undefined { + return this.findEntry(path, axis, { ...options, kind: "file" }); + } + + protected abstract getOwnEntries(): KeyedCollection; + + protected raiseOnChildAdded(entry: VirtualFile | VirtualDirectory) { + if (this._childAddedCallbacks) { + for (const callback of this._childAddedCallbacks) { + callback(entry); + } + } + } + + protected raiseOnChildRemoved(entry: VirtualFile | VirtualDirectory) { + if (this._childRemovedCallbacks) { + for (const callback of this._childRemovedCallbacks) { + callback(entry); + } + } + } + } + + export class VirtualFileSystem extends VirtualFileSystemContainer { + // private static _builtLocal: VirtualFileSystem | undefined; + // private static _builtLocalCI: VirtualFileSystem | undefined; + // private static _builtLocalCS: VirtualFileSystem | undefined; + + private _root: VirtualDirectory; + private _useCaseSensitiveFileNames: boolean; + private _currentDirectory: string; + private _currentDirectoryStack: string[] | undefined; + private _shadowRoot: VirtualFileSystem | undefined; + + constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean) { + super(""); + this._currentDirectory = currentDirectory.replace(/\\/g, "/"); + this._useCaseSensitiveFileNames = useCaseSensitiveFileNames; + } + + public get fileSystem(): VirtualFileSystem { + return this; + } + + public get parent(): VirtualFileSystemContainer { + return this; + } + + public get shadowRoot(): VirtualFileSystem | undefined { + return this._shadowRoot; + } + + public get useCaseSensitiveFileNames() { + return this._useCaseSensitiveFileNames; + } + + public get currentDirectory() { + return this._currentDirectory; + } + + public get path() { + return ""; + } + + public get relative() { + return ""; + } + + public get exists() { + return true; + } + + public get root() { + if (this._root === undefined) { + if (this._shadowRoot) { + this._root = this._shadowRoot.root.shadow(this); + } + else { + this._root = new VirtualDirectory(this, ""); + } + if (this.isReadOnly) this._root.makeReadOnly(); + } + return this._root; + } + + // public static getBuiltLocal(useCaseSensitiveFileNames: boolean = io.useCaseSensitiveFileNames()): VirtualFileSystem { + // let vfs = useCaseSensitiveFileNames ? this._builtLocalCS : this._builtLocalCI; + // if (!vfs) { + // vfs = this._builtLocal; + // if (!vfs) { + // const resolver = createResolver(io, { + // "/.ts": getBuiltDirectory(), + // "/.lib": getLibFilesDirectory() + // }); + // vfs = new VirtualFileSystem("/", io.useCaseSensitiveFileNames()); + // vfs.addDirectory("/.ts", resolver); + // vfs.addDirectory("/.lib", resolver); + // vfs.addDirectory("/.test"); + // vfs.changeDirectory("/.test"); + // vfs.makeReadOnly(); + // this._builtLocal = vfs; + // } + // if (vfs._useCaseSensitiveFileNames !== useCaseSensitiveFileNames) { + // vfs = vfs.shadow(); + // vfs._useCaseSensitiveFileNames = useCaseSensitiveFileNames; + // vfs.makeReadOnly(); + // } + // return useCaseSensitiveFileNames + // ? this._builtLocalCS = vfs + // : this._builtLocalCI = vfs; + // } + // return vfs; + // } + + // public static createFromOptions(options: { useCaseSensitiveFileNames?: boolean, currentDirectory?: string }) { + // const vfs = this.getBuiltLocal(options.useCaseSensitiveFileNames).shadow(); + // if (options.currentDirectory) { + // vfs.addDirectory(options.currentDirectory); + // vfs.changeDirectory(options.currentDirectory); + // } + // return vfs; + // } + + // public static createFromDocuments(options: { useCaseSensitiveFileNames?: boolean, currentDirectory?: string }, documents: TextDocument[], fileOptions?: { overwrite?: boolean }) { + // const vfs = this.createFromOptions(options); + // for (const document of documents) { + // const file = vfs.addFile(document.file, document.text, fileOptions)!; + // assert.isDefined(file, `Failed to add file: '${document.file}'`); + // file.metadata.set("document", document); + // // Add symlinks + // const symlink = document.meta.get("symlink"); + // if (file && symlink) { + // for (const link of symlink.split(",")) { + // const symlink = vfs.addSymlink(vpath.resolve(vfs.currentDirectory, link.trim()), file)!; + // assert.isDefined(symlink, `Failed to symlink: '${link}'`); + // symlink.metadata.set("document", document); + // } + // } + // } + // return vfs; + // } + + public changeDirectory(path: string) { + this.writePreamble(); + if (path) { + this._currentDirectory = vpath.resolve(this._currentDirectory, path); + } + } + + public pushDirectory(path = this.currentDirectory) { + this.writePreamble(); + if (this._currentDirectoryStack === undefined) { + this._currentDirectoryStack = [this.currentDirectory]; + } + else { + this._currentDirectoryStack.push(this.currentDirectory); + } + this.changeDirectory(path); + } + + public popDirectory() { + this.writePreamble(); + const previousDirectory = this._currentDirectoryStack && this._currentDirectoryStack.pop(); + if (previousDirectory !== undefined) { + this._currentDirectory = previousDirectory; + } + } + + public addDirectory(path: string /*, resolver?: FileSystemResolver */) { + return this.root.addDirectory(vpath.resolve(this.currentDirectory, path) /*, resolver */); + } + + public addFile(path: string, content?: /*FileSystemResolver["getContent"] |*/ string, options?: { overwrite?: boolean }) { + return this.root.addFile(vpath.resolve(this.currentDirectory, path), content, options); + } + + public addSymlink(path: string, target: VirtualFile): VirtualFileSymlink | undefined; + public addSymlink(path: string, target: VirtualDirectory): VirtualDirectorySymlink | undefined; + public addSymlink(path: string, target: string | VirtualFile | VirtualDirectory): VirtualSymlink | undefined; + public addSymlink(path: string, target: string | VirtualFile | VirtualDirectory) { + if (typeof target === "string") target = vpath.resolve(this.currentDirectory, target); + return this.root.addSymlink(vpath.resolve(this.currentDirectory, path), target); + } + + public removeDirectory(path: string): boolean { + return this.root.removeDirectory(vpath.resolve(this.currentDirectory, path)); + } + + public removeFile(path: string): boolean { + return this.root.removeFile(vpath.resolve(this.currentDirectory, path)); + } + + public readFile(path: string): string | undefined { + const file = this.getFile(vpath.resolve(this.currentDirectory, path)); + return file && file.getContent(); + } + + public writeFile(path: string, content: string): void { + path = vpath.resolve(this.currentDirectory, path); + const file = this.getFile(path) || this.addFile(path); + if (file) { + file.setContent(content); + } + } + + public directoryExists(path: string) { + return this.getEntry(path) instanceof VirtualDirectory; + } + + public fileExists(path: string) { + return this.getEntry(path) instanceof VirtualFile; + } + + public sameName(a: string, b: string) { + return compareStrings(a, b, !this.useCaseSensitiveFileNames) === 0; + } + + public getRealEntry(entry: VirtualDirectory): VirtualDirectory | undefined; + public getRealEntry(entry: VirtualFile): VirtualFile | undefined; + public getRealEntry(entry: VirtualFile | VirtualDirectory): VirtualFile | VirtualDirectory | undefined; + public getRealEntry(entry: VirtualFile | VirtualDirectory): VirtualFile | VirtualDirectory | undefined { + if (entry instanceof VirtualFileSymlink || entry instanceof VirtualDirectorySymlink) { + return findTarget(this, entry.target); + } + return entry; + } + + public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; + public getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; + public getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }) { + return this.root.getEntry(vpath.resolve(this.currentDirectory, path), options); + } + + public getFile(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp }): VirtualFile | undefined { + return this.root.getFile(vpath.resolve(this.currentDirectory, path), options); + } + + public getDirectory(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp }): VirtualDirectory | undefined { + return this.root.getDirectory(vpath.resolve(this.currentDirectory, path), options); + } + + public getAccessibleFileSystemEntries(path: string) { + const entry = this.getEntry(path); + if (entry instanceof VirtualDirectory) { + return { + files: entry.getFiles().map(f => f.name), + directories: entry.getDirectories().map(d => d.name) + }; + } + return { files: [], directories: [] }; + } + + public shadow(): VirtualFileSystem { + const fs = new VirtualFileSystem(this.currentDirectory, this.useCaseSensitiveFileNames); + fs._shadowRoot = this; + return fs; + } + + public debugPrint(): void { + console.log(`cwd: ${this.currentDirectory}`); + for (const entry of this.getEntries({ recursive: true })) { + if (entry instanceof VirtualDirectory) { + console.log(entry.path.endsWith("/") ? entry.path : entry.path + "/"); + if (entry instanceof VirtualDirectorySymlink) { + console.log(`-> ${entry.target.endsWith("/") ? entry.target : entry.target + "/"}`); + } + } + else { + console.log(entry.path); + if (entry instanceof VirtualFileSymlink) { + console.log(`-> ${entry.target}`); + } + } + } + } + + protected makeReadOnlyCore() { + this.root.makeReadOnly(); + } + + protected getOwnEntries() { + return this.root["getOwnEntries"](); + } + } + + export class VirtualDirectory extends VirtualFileSystemContainer { + protected _shadowRoot: VirtualDirectory | undefined; + private _parent: VirtualFileSystemContainer; + private _entries: KeyedCollection | undefined; + // private _resolver: FileSystemResolver | undefined; + + constructor(parent: VirtualFileSystemContainer, name: string /*, resolver?: FileSystemResolver */) { + super(name); + this._parent = parent; + this._entries = undefined; + // this._resolver = resolver; + this._shadowRoot = undefined; + } + + public get parent(): VirtualFileSystemContainer { + return this._parent; + } + + public get shadowRoot(): VirtualDirectory | undefined { + return this._shadowRoot; + } + + public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; + public getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; + public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualFile | VirtualDirectory | undefined { + const components = this.parsePath(path); + const directory = this.walkContainers(components, /*create*/ false); + return directory && directory.getOwnEntry(components[components.length - 1], options); + } + + public addDirectory(path: string /*, resolver?: FileSystemResolver*/): VirtualDirectory | undefined { + this.writePreamble(); + const components = this.parsePath(path); + const directory = this.walkContainers(components, /*create*/ true); + return directory && directory.addOwnDirectory(components[components.length - 1] /*, resolver*/); + } + + public addFile(path: string, content?: /*FileSystemResolver["getContent"] |*/ string | undefined, options?: { overwrite?: boolean }): VirtualFile | undefined { + this.writePreamble(); + const components = this.parsePath(path); + const directory = this.walkContainers(components, /*create*/ true); + return directory && directory.addOwnFile(components[components.length - 1], content, options); + } + + public addSymlink(path: string, target: VirtualFile): VirtualFileSymlink | undefined; + public addSymlink(path: string, target: VirtualDirectory): VirtualDirectorySymlink | undefined; + public addSymlink(path: string, target: string | VirtualFile | VirtualDirectory): VirtualSymlink | undefined; + public addSymlink(path: string, target: string | VirtualFile | VirtualDirectory): VirtualSymlink | undefined { + this.writePreamble(); + const targetEntry = typeof target === "string" ? this.fileSystem.getEntry(vpath.resolve(this.path, target)) : target; + if (targetEntry === undefined) return undefined; + const components = this.parsePath(path); + const directory = this.walkContainers(components, /*create*/ true); + return directory && directory.addOwnSymlink(components[components.length - 1], targetEntry); + } + + public removeDirectory(path: string): boolean { + this.writePreamble(); + const components = this.parsePath(path); + const directory = this.walkContainers(components, /*create*/ false); + return directory ? directory.removeOwnDirectory(components[components.length - 1]) : false; + } + + public removeFile(path: string): boolean { + this.writePreamble(); + this.writePreamble(); + const components = this.parsePath(path); + const directory = this.walkContainers(components, /*create*/ false); + return directory ? directory.removeOwnFile(components[components.length - 1]) : false; + } + + public shadow(parent: VirtualFileSystemContainer): VirtualDirectory { + this.shadowPreamble(parent); + const shadow = new VirtualDirectory(parent, this.name); + shadow._shadowRoot = this; + return shadow; + } + + protected makeReadOnlyCore(): void { + if (this._entries) { + this._entries.forEach(entry => entry.makeReadOnly()); + } + } + + protected getOwnEntries() { + if (!this._entries) { + // const resolver = this._resolver; + const entries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); + // this._resolver = undefined; + /*if (resolver) { + const { files, directories } = resolver.getEntries(this); + for (const dir of directories) { + const vdir = new VirtualDirectory(this, dir, resolver); + if (this.isReadOnly) vdir.makeReadOnly(); + entries.set(vdir.name, vdir); + } + for (const file of files) { + const vfile = new VirtualFile(this, file, file => resolver.getContent(file)); + if (this.isReadOnly) vfile.makeReadOnly(); + entries.set(vfile.name, vfile); + } + } + else*/ if (this._shadowRoot) { + this._shadowRoot.getOwnEntries().forEach(entry => { + const clone = (entry).shadow(this); + if (this.isReadOnly) clone.makeReadOnly(); + entries.set(clone.name, clone); + }); + } + this._entries = entries; + } + return this._entries; + } + + private parsePath(path: string) { + return vpath.parse(vpath.normalize(path)); + } + + private walkContainers(components: string[], create: boolean) { + // no absolute paths (unless this is the root) + if (!!components[0] === !(this.parent instanceof VirtualFileSystem)) return undefined; + + // no relative paths + if (components[1] === "..") return undefined; + + // walk the components + let directory: VirtualDirectory | undefined = this; + for (let i = this.parent instanceof VirtualFileSystem ? 0 : 1; i < components.length - 1; i++) { + directory = create ? directory.getOrAddOwnDirectory(components[i]) : directory.getOwnDirectory(components[i]); + if (directory === undefined) return undefined; + } + + return directory; + } + + private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; + private getOwnEntry(name: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; + private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualFile | VirtualDirectory | undefined { + const entry = this.getOwnEntries().get(name); + return entry && isMatch(entry, options) ? options.followSymlinks ? this.fileSystem.getRealEntry(entry) : entry : undefined; + } + + private getOwnDirectory(name: string) { + return this.getOwnEntry(name, { kind: "directory" }); + } + + private getOrAddOwnDirectory(name: string) { + return this.getOwnDirectory(name) || this.addOwnDirectory(name); + } + + private addOwnDirectory(name: string /*, resolver?: FileSystemResolver */): VirtualDirectory | undefined { + const existing = this.getOwnEntry(name); + if (existing) { + if (/*!resolver &&*/ existing instanceof VirtualDirectory) { + return existing; + } + return undefined; + } + + const entry = new VirtualDirectory(this, name /*, resolver */); + this.getOwnEntries().set(entry.name, entry); + this.raiseOnChildAdded(entry); + return entry; + } + + private addOwnFile(name: string, content?: /*FileSystemResolver["getContent"]*/ | string | undefined, options: { overwrite?: boolean } = {}): VirtualFile | undefined { + const existing = this.getOwnEntry(name); + if (existing) { + if (!options.overwrite || !(existing instanceof VirtualFile)) { + return undefined; + } + + // Remove the existing entry + this.getOwnEntries().delete(name); + } + + const entry = new VirtualFile(this, name, content); + this.getOwnEntries().set(entry.name, entry); + this.raiseOnChildAdded(entry); + return entry; + } + + private addOwnSymlink(name: string, target: VirtualFile | VirtualDirectory): VirtualSymlink | undefined { + if (this.getOwnEntry(name)) return undefined; + const entry = target instanceof VirtualFile ? new VirtualFileSymlink(this, name, target.path) : new VirtualDirectorySymlink(this, name, target.path); + this.getOwnEntries().set(entry.name, entry); + this.raiseOnChildAdded(entry); + return entry; + } + + private removeOwnDirectory(name: string) { + const entries = this.getOwnEntries(); + const entry = entries.get(name); + if (entry instanceof VirtualDirectory) { + entries.delete(name); + this.raiseOnChildRemoved(entry); + return true; + } + return false; + } + + private removeOwnFile(name: string) { + const entries = this.getOwnEntries(); + const entry = entries.get(name); + if (entry instanceof VirtualFile) { + entries.delete(name); + this.raiseOnChildRemoved(entry); + return true; + } + return false; + } + } + + export class VirtualDirectorySymlink extends VirtualDirectory { + private _targetPath: string; + private _target: VirtualDirectory | undefined; + private _symLinks = new Map(); + private _symEntries: KeyedCollection | undefined; + private _onTargetParentChildRemoved: (entry: VirtualFile | VirtualDirectory) => void; + private _onTargetChildRemoved: (entry: VirtualFile | VirtualDirectory) => void; + private _onTargetChildAdded: (entry: VirtualFile | VirtualDirectory) => void; + + constructor(parent: VirtualFileSystemContainer, name: string, target: string) { + super(parent, name); + this._targetPath = target; + this._onTargetParentChildRemoved = entry => this.onTargetParentChildRemoved(entry); + this._onTargetChildAdded = entry => this.onTargetChildAdded(entry); + this._onTargetChildRemoved = entry => this.onTargetChildRemoved(entry); + } + + public get target() { + return this._targetPath; + } + + public set target(value: string) { + this.writePreamble(); + if (this._targetPath !== value) { + this._targetPath = value; + this.invalidateTarget(); + } + } + + public get isBroken(): boolean { + return this.getRealDirectory() === undefined; + } + + public getRealDirectory(): VirtualDirectory | undefined { + this.resolveTarget(); + return this._target; + } + + public addDirectory(path: string /*, resolver?: FileSystemResolver*/): VirtualDirectory | undefined { + const target = this.getRealDirectory(); + return target && target.addDirectory(path /*, resolver*/); + } + + public addFile(path: string, content?: /*FileSystemResolver["getContent"]*/ | string | undefined): VirtualFile | undefined { + const target = this.getRealDirectory(); + return target && target.addFile(path, content); + } + + public removeDirectory(path: string): boolean { + const target = this.getRealDirectory(); + return target && target.removeDirectory(path) || false; + } + + public removeFile(path: string): boolean { + const target = this.getRealDirectory(); + return target && target.removeFile(path) || false; + } + + public shadow(parent: VirtualFileSystemContainer): VirtualDirectorySymlink { + this.shadowPreamble(parent); + const shadow = new VirtualDirectorySymlink(parent, this.name, this.target); + shadow._shadowRoot = this; + return shadow; + } + + public resolveTarget(): void { + if (!this._target) { + const entry = findTarget(this.fileSystem, this.target); + if (entry instanceof VirtualDirectory) { + this._target = entry; + this._target.parent.addOnChildRemoved(this._onTargetParentChildRemoved); + this._target.addOnChildAdded(this._onTargetChildAdded); + this._target.addOnChildRemoved(this._onTargetChildRemoved); + } + } + } + + protected getOwnEntries(): KeyedCollection { + if (!this._symEntries) { + const target = this.getRealDirectory(); + this._symEntries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); + if (target) { + for (const entry of target.getEntries()) { + this._symEntries.set(entry.name, this.getWrappedEntry(entry)); + } + } + } + return this._symEntries; + } + + private getWrappedEntry(entry: VirtualFile | VirtualDirectory) { + let symlink = this._symLinks.get(entry); + if (entry instanceof VirtualFile) { + if (symlink instanceof VirtualFileSymlink) { + return symlink; + } + symlink = new VirtualFileSymlink(this, entry.name, entry.path); + this._symLinks.set(entry, symlink); + } + else { + if (symlink instanceof VirtualDirectorySymlink) { + return symlink; + } + symlink = new VirtualDirectorySymlink(this, entry.name, entry.path); + this._symLinks.set(entry, symlink); + } + return symlink; + } + + private onTargetParentChildRemoved(entry: VirtualFileSystemEntry) { + if (entry !== this._target) return; + this.invalidateTarget(); + } + + private onTargetChildAdded(entry: VirtualFile | VirtualDirectory) { + const wrapped = this.getWrappedEntry(entry); + this.getOwnEntries().set(entry.name, wrapped); + this.raiseOnChildAdded(wrapped); + } + + private onTargetChildRemoved(entry: VirtualFile | VirtualDirectory) { + const wrapped = this.getWrappedEntry(entry); + this.getOwnEntries().delete(entry.name); + this._symLinks.delete(entry); + this.raiseOnChildRemoved(wrapped); + } + + private invalidateTarget() { + if (!this._target) return; + this._target.parent.removeOnChildRemoved(this._onTargetParentChildRemoved); + this._target.removeOnChildAdded(this._onTargetChildAdded); + this._target.removeOnChildRemoved(this._onTargetChildRemoved); + this._target = undefined; + this._symLinks.clear(); + this._symEntries = undefined; + } + } + + export class VirtualFile extends VirtualFileSystemEntry { + protected _shadowRoot: VirtualFile | undefined; + private _parent: VirtualDirectory; + private _content: string | undefined; + private _contentWasSet: boolean; + // private _resolver: FileSystemResolver["getContent"] | undefined; + + constructor(parent: VirtualDirectory, name: string, content?: /*FileSystemResolver["getContent"]*/ | string | undefined) { + super(name); + this._parent = parent; + this._content = typeof content === "string" ? content : undefined; + // this._resolver = typeof content === "function" ? content : undefined; + this._shadowRoot = undefined; + this._contentWasSet = this._content !== undefined; + } + + public get parent(): VirtualDirectory { + return this._parent; + } + + public get shadowRoot(): VirtualFile | undefined { + return this._shadowRoot; + } + + public getContent(): string | undefined { + if (!this._contentWasSet) { + // const resolver = this._resolver; + const shadowRoot = this._shadowRoot; + /* if (resolver) { + this._content = resolver(this); + this._contentWasSet = true; + } + else */ if (shadowRoot) { + this._content = shadowRoot.getContent(); + this._contentWasSet = true; + } + } + return this._content; + } + + public setContent(value: string | undefined) { + this.writePreamble(); + // this._resolver = undefined; + this._content = value; + this._contentWasSet = true; + } + + public shadow(parent: VirtualDirectory): VirtualFile { + this.shadowPreamble(parent); + const shadow = new VirtualFile(parent, this.name); + shadow._shadowRoot = this; + shadow._contentWasSet = false; + return shadow; + } + + protected makeReadOnlyCore(): void { + } + } + + export class VirtualFileSymlink extends VirtualFile { + private _target: string; + + constructor(parent: VirtualDirectory, name: string, target: string) { + super(parent, name); + this._target = target; + } + + public get target(): string { + return this._target; + } + + public set target(value: string) { + this.writePreamble(); + this._target = value; + } + + public get isBroken(): boolean { + return this.getRealFile() === undefined; + } + + public getRealFile(): VirtualFile | undefined { + const entry = findTarget(this.fileSystem, this.target); + return entry instanceof VirtualFile ? entry : undefined; + } + + public getContent(): string | undefined { + const target = this.getRealFile(); + return target && target.getContent(); + } + + public setContent(value: string | undefined) { + const target = this.getRealFile(); + if (target) target.setContent(value); + } + + public shadow(parent: VirtualDirectory) { + this.shadowPreamble(parent); + const shadow = new VirtualFileSymlink(parent, this.name, this.target); + shadow._shadowRoot = this; + return shadow; + } + } + + export type VirtualSymlink = VirtualDirectorySymlink | VirtualFileSymlink; + + function findTarget(vfs: VirtualFileSystem, target: string, set?: Set): VirtualFile | VirtualDirectory | undefined { + const entry = vfs.getEntry(target); + if (entry instanceof VirtualFileSymlink || entry instanceof VirtualDirectorySymlink) { + if (!set) set = new Set(); + if (set.has(entry)) return undefined; + set.add(entry); + return findTarget(vfs, entry.target, set); + } + return entry; + } + + function isMatch(entry: VirtualFile | VirtualDirectory, options: { pattern?: RegExp, kind?: "file" | "directory" }) { + return (options.pattern === undefined || options.pattern.test(entry.name)) + && (options.kind !== (entry instanceof VirtualFile ? "directory" : "file")); + } + + // TODO(rbuckton): Move or retire this. + export class MockParseConfigHost extends VirtualFileSystem implements ts.ParseConfigHost { + constructor(currentDirectory: string, ignoreCase: boolean, files: ts.Map | string[]) { + super(currentDirectory, ignoreCase); + if (files instanceof Array) { + for (const file of files) { + // this.addFile(file, new Harness.LanguageService.ScriptInfo(file, undefined, /*isRootFile*/false)); + this.addFile(file).metadata.set("scriptInfo", new Harness.LanguageService.ScriptInfo(file, undefined, /*isRootFile*/ false)); + } + } + else { + files.forEach((fileContent, fileName) => { + this.addFile(fileName, fileContent).metadata.set("scriptInfo", new Harness.LanguageService.ScriptInfo(fileName, fileContent, /*isRootFile*/ false)); + }); + } + } + + readDirectory(path: string, extensions: ReadonlyArray, excludes: ReadonlyArray, includes: ReadonlyArray, depth: number) { + return ts.matchFiles(path, extensions, excludes, includes, this.useCaseSensitiveFileNames, this.currentDirectory, depth, (path: string) => this.getAccessibleFileSystemEntries(path)); + } + } +} \ No newline at end of file diff --git a/src/harness/virtualFileSystem.ts b/src/harness/virtualFileSystem.ts deleted file mode 100644 index 8accd6f621e44..0000000000000 --- a/src/harness/virtualFileSystem.ts +++ /dev/null @@ -1,223 +0,0 @@ -/// -/// -namespace Utils { - export class VirtualFileSystemEntry { - fileSystem: VirtualFileSystem; - name: string; - - constructor(fileSystem: VirtualFileSystem, name: string) { - this.fileSystem = fileSystem; - this.name = name; - } - - isDirectory(): this is VirtualDirectory { return false; } - isFile(): this is VirtualFile { return false; } - isFileSystem(): this is VirtualFileSystem { return false; } - } - - export class VirtualFile extends VirtualFileSystemEntry { - content?: Harness.LanguageService.ScriptInfo; - isFile() { return true; } - } - - export abstract class VirtualFileSystemContainer extends VirtualFileSystemEntry { - abstract getFileSystemEntries(): VirtualFileSystemEntry[]; - - getFileSystemEntry(name: string): VirtualFileSystemEntry { - for (const entry of this.getFileSystemEntries()) { - if (this.fileSystem.sameName(entry.name, name)) { - return entry; - } - } - return undefined; - } - - getDirectories(): VirtualDirectory[] { - return ts.filter(this.getFileSystemEntries(), entry => entry.isDirectory()); - } - - getFiles(): VirtualFile[] { - return ts.filter(this.getFileSystemEntries(), entry => entry.isFile()); - } - - getDirectory(name: string): VirtualDirectory { - const entry = this.getFileSystemEntry(name); - return entry.isDirectory() ? entry : undefined; - } - - getFile(name: string): VirtualFile { - const entry = this.getFileSystemEntry(name); - return entry.isFile() ? entry : undefined; - } - } - - export class VirtualDirectory extends VirtualFileSystemContainer { - private entries: VirtualFileSystemEntry[] = []; - - isDirectory() { return true; } - - getFileSystemEntries() { return this.entries.slice(); } - - addDirectory(name: string): VirtualDirectory { - const entry = this.getFileSystemEntry(name); - if (entry === undefined) { - const directory = new VirtualDirectory(this.fileSystem, name); - this.entries.push(directory); - return directory; - } - else if (entry.isDirectory()) { - return entry; - } - else { - return undefined; - } - } - - addFile(name: string, content?: Harness.LanguageService.ScriptInfo): VirtualFile { - const entry = this.getFileSystemEntry(name); - if (entry === undefined) { - const file = new VirtualFile(this.fileSystem, name); - file.content = content; - this.entries.push(file); - return file; - } - else if (entry.isFile()) { - entry.content = content; - return entry; - } - else { - return undefined; - } - } - } - - export class VirtualFileSystem extends VirtualFileSystemContainer { - private root: VirtualDirectory; - - currentDirectory: string; - useCaseSensitiveFileNames: boolean; - - constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean) { - super(/*fileSystem*/ undefined, ""); - this.fileSystem = this; - this.root = new VirtualDirectory(this, ""); - this.currentDirectory = currentDirectory; - this.useCaseSensitiveFileNames = useCaseSensitiveFileNames; - } - - isFileSystem() { return true; } - - getFileSystemEntries() { return this.root.getFileSystemEntries(); } - - addDirectory(path: string) { - path = ts.normalizePath(path); - const components = ts.getNormalizedPathComponents(path, this.currentDirectory); - let directory: VirtualDirectory = this.root; - for (const component of components) { - directory = directory.addDirectory(component); - if (directory === undefined) { - break; - } - } - - return directory; - } - - addFile(path: string, content?: Harness.LanguageService.ScriptInfo) { - const absolutePath = ts.normalizePath(ts.getNormalizedAbsolutePath(path, this.currentDirectory)); - const fileName = ts.getBaseFileName(path); - const directoryPath = ts.getDirectoryPath(absolutePath); - const directory = this.addDirectory(directoryPath); - return directory ? directory.addFile(fileName, content) : undefined; - } - - fileExists(path: string) { - const entry = this.traversePath(path); - return entry !== undefined && entry.isFile(); - } - - sameName(a: string, b: string) { - return this.useCaseSensitiveFileNames ? a === b : a.toLowerCase() === b.toLowerCase(); - } - - traversePath(path: string) { - path = ts.normalizePath(path); - let directory: VirtualDirectory = this.root; - for (const component of ts.getNormalizedPathComponents(path, this.currentDirectory)) { - const entry = directory.getFileSystemEntry(component); - if (entry === undefined) { - return undefined; - } - else if (entry.isDirectory()) { - directory = entry; - } - else { - return entry; - } - } - - return directory; - } - - /** - * Reads the directory at the given path and retrieves a list of file names and a list - * of directory names within it. Suitable for use with ts.matchFiles() - * @param path The path to the directory to be read - */ - 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) - }; - } - return { files: [], directories: [] }; - } - - getAllFileEntries() { - const fileEntries: VirtualFile[] = []; - getFilesRecursive(this.root, fileEntries); - return fileEntries; - - function getFilesRecursive(dir: VirtualDirectory, result: VirtualFile[]) { - const files = dir.getFiles(); - const dirs = dir.getDirectories(); - for (const file of files) { - result.push(file); - } - for (const subDir of dirs) { - getFilesRecursive(subDir, result); - } - } - } - } - - export class MockParseConfigHost extends VirtualFileSystem implements ts.ParseConfigHost { - constructor(currentDirectory: string, ignoreCase: boolean, files: ts.Map | string[]) { - super(currentDirectory, ignoreCase); - if (files instanceof Array) { - for (const file of files) { - this.addFile(file, new Harness.LanguageService.ScriptInfo(file, undefined, /*isRootFile*/false)); - } - } - else { - files.forEach((fileContent, fileName) => { - this.addFile(fileName, new Harness.LanguageService.ScriptInfo(fileName, fileContent, /*isRootFile*/false)); - }); - } - } - - readFile(path: string): string | undefined { - const value = this.traversePath(path); - if (value && value.isFile()) { - return value.content.content; - } - } - - readDirectory(path: string, extensions: ReadonlyArray, excludes: ReadonlyArray, includes: ReadonlyArray, depth: number) { - return ts.matchFiles(path, extensions, excludes, includes, this.useCaseSensitiveFileNames, this.currentDirectory, depth, (path: string) => this.getAccessibleFileSystemEntries(path)); - } - } -} \ No newline at end of file diff --git a/src/harness/vpath.ts b/src/harness/vpath.ts new file mode 100644 index 0000000000000..b2e98a4859fec --- /dev/null +++ b/src/harness/vpath.ts @@ -0,0 +1,161 @@ +/// + +namespace vpath { + import compareStrings = ts.compareStrings; + + export function normalizeSlashes(path: string): string { + return path.replace(/\s*[\\/]\s*/g, "/").trim(); + } + + const rootRegExp = /^[\\/]([\\/](.*?[\\/](.*?[\\/])?)?)?|^[a-zA-Z]:[\\/]?|^\w+:\/{2}[^\\/]*\/?/; + + function getRootLength(path: string) { + const match = rootRegExp.exec(path); + return match ? match[0].length : 0; + } + + export function isAbsolute(path: string) { + return rootRegExp.test(path); + } + + const trailingSeperatorRegExp = /[\\/]$/; + + export function hasTrailingSeperator(path: string) { + return trailingSeperatorRegExp.test(path); + } + + function reduce(components: string[]) { + const normalized = [components[0]]; + for (let i = 1; i < components.length; i++) { + const component = components[i]; + if (component === ".") continue; + if (component === ".." && normalized.length > 0 && normalized[normalized.length - 1] !== "..") { + normalized.pop(); + } + else { + normalized.push(component); + } + } + return normalized; + } + + export function normalize(path: string): string { + const components = reduce(parse(path)); + return components.length > 1 && hasTrailingSeperator(path) ? format(components) + "/" : format(components); + } + + export function combine(path: string, ...paths: string[]) { + path = normalizeSlashes(path); + for (let name of paths) { + name = normalizeSlashes(name); + if (name.length === 0) continue; + if (path.length === 0 || isAbsolute(name)) { + path = name; + } + else { + path = hasTrailingSeperator(path) ? path + name : path + "/" + name; + } + } + return path; + } + + export function resolve(path: string, ...paths: string[]) { + return normalize(combine(path, ...paths)); + } + + export function relative(from: string, to: string, ignoreCase: boolean) { + if (!isAbsolute(from)) throw new Error("Path not absolute"); + if (!isAbsolute(to)) throw new Error("Path not absolute"); + + const fromComponents = reduce(parse(from)); + const toComponents = reduce(parse(to)); + + let start: number; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + if (compareStrings(fromComponents[start], toComponents[start], ignoreCase)) { + break; + } + } + + if (start === 0 || (start === 1 && fromComponents[0] === "/")) { + return format(toComponents); + } + + const components = toComponents.slice(start); + for (; start < fromComponents.length; start++) { + components.unshift(".."); + } + + return format(["", ...components]); + } + + export function beneath(ancestor: string, descendant: string, ignoreCase: boolean) { + if (!isAbsolute(ancestor)) throw new Error("Path not absolute"); + if (!isAbsolute(descendant)) throw new Error("Path not absolute"); + + const ancestorComponents = reduce(parse(ancestor)); + const descendantComponents = reduce(parse(descendant)); + + let start: number; + for (start = 0; start < ancestorComponents.length && start < descendantComponents.length; start++) { + if (compareStrings(ancestorComponents[start], descendantComponents[start], ignoreCase)) { + break; + } + } + + return start === ancestorComponents.length; + } + + export function parse(path: string) { + path = normalizeSlashes(path); + const rootLength = getRootLength(path); + const root = path.substring(0, rootLength); + const rest = path.substring(rootLength).split(/\/+/g); + if (rest.length && !rest[rest.length - 1]) rest.pop(); + return [root, ...rest.map(component => component.trim())]; + } + + export function format(components: string[]) { + return components.length ? components[0] + components.slice(1).join("/") : ""; + } + + export function dirname(path: string) { + path = normalizeSlashes(path); + return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf("/"))); + } + + export function basename(path: string, ext?: string): string; + export function basename(path: string, options?: { extensions?: string[], ignoreCase?: boolean }): string; + export function basename(path: string, options?: { extensions?: string[], ignoreCase?: boolean } | string) { + path = normalizeSlashes(path); + const name = path.substr(Math.max(getRootLength(path), path.lastIndexOf("/") + 1)); + const extension = typeof options === "string" ? options.startsWith(".") ? options : "." + options : + options && options.extensions ? extname(name, options) : + undefined; + return extension ? name.slice(0, name.length - extension.length) : name; + } + + const extRegExp = /\.\w+$/; + export function extname(path: string, options?: { extensions?: string[], ignoreCase?: boolean }) { + if (options && options.extensions) { + for (let extension of options.extensions) { + if (!extension.startsWith(".")) extension = "." + extension; + if (path.length > extension.length) { + const ext = path.slice(path.length - extension.length); + if (compareStrings(ext, extension, options.ignoreCase) === 0) { + return ext; + } + } + } + return ""; + } + + const match = extRegExp.exec(path); + return match ? match[0] : ""; + } + + export function chext(path: string, ext: string, options?: { extensions?: string[], ignoreCase?: boolean }) { + const pathext = extname(path, options); + return pathext ? path.slice(0, path.length - pathext.length) + (ext.startsWith(".") ? ext : "." + ext) : path; + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/findAllRefsForModule.ts b/tests/cases/fourslash/findAllRefsForModule.ts index ae6b216463ff2..cfed334640570 100644 --- a/tests/cases/fourslash/findAllRefsForModule.ts +++ b/tests/cases/fourslash/findAllRefsForModule.ts @@ -18,6 +18,6 @@ verify.noErrors(); const ranges = test.ranges(); const [r0, r1, r2] = ranges; -verify.referenceGroups([r0, r1], [{ definition: 'module "/a"', ranges: [r0, r2, r1] }]); +verify.referenceGroups([r0, r1], [{ definition: 'module "/a"', ranges: [r0, r1, r2] }]); // TODO:GH#15736 verify.referenceGroups(r2, undefined); From 41aeaae7c1bb740274f5d14fc7f8e17d7860cbf7 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 19 Oct 2017 17:48:13 -0700 Subject: [PATCH 02/54] Cleanup, add watch capabilities --- Jakefile.js | 1 + src/harness/collections.ts | 48 +- src/harness/events.ts | 26 + src/harness/harness.ts | 547 ++++--- src/harness/harnessLanguageService.ts | 8 +- src/harness/tsconfig.json | 1 + src/harness/vfs.ts | 1633 +++++++++++++-------- src/harness/virtualFileSystemWithWatch.ts | 2 + src/harness/vpath.ts | 102 +- tests/webTestServer.ts | 942 ++++++++---- 10 files changed, 2212 insertions(+), 1098 deletions(-) create mode 100644 src/harness/events.ts diff --git a/Jakefile.js b/Jakefile.js index 49641cab710ab..621111aa7f750 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -95,6 +95,7 @@ var harnessCoreSources = [ "harness.ts", "collections.ts", "vpath.ts", + "events.ts", "vfs.ts", "virtualFileSystemWithWatch.ts", "sourceMapRecorder.ts", diff --git a/src/harness/collections.ts b/src/harness/collections.ts index e0f5e9a2aea52..7d661cdeacc42 100644 --- a/src/harness/collections.ts +++ b/src/harness/collections.ts @@ -1,13 +1,23 @@ /// -namespace Collections { - import compareValues = ts.compareValues; +namespace collections { + // NOTE: Some of the functions here duplicate functionality from compiler/core.ts. They have been added + // to reduce the number of direct dependencies on compiler and services to eventually break away + // from depending directly on the compiler to speed up compilation time. + import binarySearch = ts.binarySearch; import removeAt = ts.orderedRemoveItemAt; + export function compareValues(a: T, b: T): number { + if (a === b) return 0; + if (a === undefined) return -1; + if (b === undefined) return +1; + return a < b ? -1 : +1; + } + const caseInsensitiveComparisonCollator = typeof Intl === "object" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined; const caseSensitiveComparisonCollator = typeof Intl === "object" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "variant" }) : undefined; - export function compareStrings(a: string | undefined, b: string | undefined, ignoreCase?: boolean) { + export function compareStrings(a: string | undefined, b: string | undefined, ignoreCase: boolean) { if (a === b) return 0; if (a === undefined) return -1; if (b === undefined) return +1; @@ -23,13 +33,8 @@ namespace Collections { } export namespace compareStrings { - export function caseSensitive(a: string | undefined, b: string | undefined) { - return compareStrings(a, b, /*ignoreCase*/ false); - } - - export function caseInsensitive(a: string | undefined, b: string | undefined) { - return compareStrings(a, b, /*ignoreCase*/ true); - } + export function caseSensitive(a: string | undefined, b: string | undefined) { return compareStrings(a, b, /*ignoreCase*/ false); } + export function caseInsensitive(a: string | undefined, b: string | undefined) { return compareStrings(a, b, /*ignoreCase*/ true); } } function insertAt(array: T[], index: number, value: T) { @@ -50,7 +55,7 @@ namespace Collections { /** * A collection of key/value pairs sorted by key. */ - export class KeyedCollection { + export class SortedCollection { private _comparer: (a: K, b: K) => number; private _keys: K[] = []; private _values: V[] = []; @@ -145,6 +150,14 @@ namespace Collections { const undefinedSentinel = {}; + function escapeKey(text: string) { + return (text.length >= 2 && text.charAt(0) === "_" && text.charAt(1) === "_" ? "_" + text : text); + } + + function unescapeKey(text: string) { + return (text.length >= 3 && text.charAt(0) === "_" && text.charAt(1) === "_" && text.charAt(2) === "_" ? text.slice(1) : text); + } + /** * A collection of metadata that supports inheritance. */ @@ -173,24 +186,25 @@ namespace Collections { } public has(key: string): boolean { - return this._map[key] !== undefined; + return this._map[escapeKey(key)] !== undefined; } public get(key: string): any { - const value = this._map[key]; + const value = this._map[escapeKey(key)]; return value === undefinedSentinel ? undefined : value; } public set(key: string, value: any): this { - this._map[key] = value === undefined ? undefinedSentinel : value; + this._map[escapeKey(key)] = value === undefined ? undefinedSentinel : value; this._size = -1; this._version++; return this; } public delete(key: string): boolean { - if (this._map[key] !== undefined) { - delete this._map[key]; + const escapedKey = escapeKey(key); + if (this._map[escapedKey] !== undefined) { + delete this._map[escapedKey]; this._size = -1; this._version++; return true; @@ -206,7 +220,7 @@ namespace Collections { public forEach(callback: (value: any, key: string, map: this) => void) { for (const key in this._map) { - callback(this._map[key], key, this); + callback(this._map[key], unescapeKey(key), this); } } } diff --git a/src/harness/events.ts b/src/harness/events.ts new file mode 100644 index 0000000000000..9443bad9dfebb --- /dev/null +++ b/src/harness/events.ts @@ -0,0 +1,26 @@ +/// +namespace events { + const _events = require("events"); + + export const EventEmitter: { + new (): EventEmitter; + prototype: EventEmitter; + defaultMaxListeners: number; + } = _events.EventEmitter; + + export interface EventEmitter { + on(event: string | symbol, listener: (...args: any[]) => void): this; + once: this["on"]; + addListener: this["on"]; + prependListener: this["on"]; + prependOnceListener: this["on"]; + removeListener: this["on"]; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): (string | symbol)[]; + listenerCount(type: string | symbol): number; + } +} \ No newline at end of file diff --git a/src/harness/harness.ts b/src/harness/harness.ts index f24ee950d7d4b..f9340088279cf 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -32,7 +32,6 @@ // this will work in the browser via browserify var _chai: typeof chai = require("chai"); var assert: typeof _chai.assert = _chai.assert; -declare var __dirname: string; // Node-specific var global: NodeJS.Global = Function("return this").call(undefined); declare var window: {}; @@ -43,9 +42,13 @@ interface XMLHttpRequest { readonly readyState: number; readonly responseText: string; readonly status: number; + readonly statusText: string; open(method: string, url: string, async?: boolean, user?: string, password?: string): void; send(data?: string): void; setRequestHeader(header: string, value: string): void; + getAllResponseHeaders(): string; + getResponseHeader(header: string): string | null; + overrideMimeType(mime: string): void; } /* tslint:enable:no-var-keyword */ @@ -489,16 +492,23 @@ namespace Harness { fileExists(fileName: string): boolean; directoryExists(path: string): boolean; deleteFile(fileName: string): void; - listFiles(path: string, filter: RegExp, options?: { recursive?: boolean }): string[]; + listFiles(path: string, filter?: RegExp, options?: { recursive?: boolean }): string[]; log(text: string): void; - getMemoryUsage?(): number; args(): string[]; getExecutingFilePath(): string; exit(exitCode?: number): void; readDirectory(path: string, extension?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; + getAccessibleFileSystemEntries(dirname: string): FileSystemEntries; tryEnableSourceMapsForHost?(): void; getEnvironmentVariable?(name: string): string; + getMemoryUsage?(): number; } + + export interface FileSystemEntries { + files: string[]; + directories: string[]; + } + export let IO: IO; // harness always uses one kind of new line @@ -508,253 +518,380 @@ namespace Harness { // Root for file paths that are stored in a virtual file system export const virtualFileSystemRoot = "/"; - namespace IOImpl { - export namespace Node { - declare const require: any; - let fs: any, pathModule: any; - if (require) { - fs = require("fs"); - pathModule = require("path"); + function createNodeIO(): IO { + let fs: any, pathModule: any; + if (require) { + fs = require("fs"); + pathModule = require("path"); + } + else { + fs = pathModule = {}; + } + + function deleteFile(path: string) { + try { + fs.unlinkSync(path); } - else { - fs = pathModule = {}; + catch (e) { } + } - export const resolvePath = (path: string) => ts.sys.resolvePath(path); - export const getCurrentDirectory = () => ts.sys.getCurrentDirectory(); - export const newLine = () => harnessNewLine; - export const useCaseSensitiveFileNames = () => ts.sys.useCaseSensitiveFileNames; - export const args = () => ts.sys.args; - export const getExecutingFilePath = () => ts.sys.getExecutingFilePath(); - export const exit = (exitCode: number) => ts.sys.exit(exitCode); - export const getDirectories: typeof IO.getDirectories = path => ts.sys.getDirectories(path); + function directoryName(path: string) { + const dirPath = pathModule.dirname(path); + // Node will just continue to repeat the root path, rather than return null + return dirPath === path ? undefined : dirPath; + } - export const readFile: typeof IO.readFile = path => ts.sys.readFile(path); - export const writeFile: typeof IO.writeFile = (path, content) => ts.sys.writeFile(path, content); - export const fileExists: typeof IO.fileExists = fs.existsSync; - export const log: typeof IO.log = s => console.log(s); - export const getEnvironmentVariable: typeof IO.getEnvironmentVariable = name => ts.sys.getEnvironmentVariable(name); + function listFiles(path: string, spec: RegExp, options?: { recursive?: boolean }) { + options = options || {}; - export function tryEnableSourceMapsForHost() { - if (ts.sys.tryEnableSourceMapsForHost) { - ts.sys.tryEnableSourceMapsForHost(); - } - } - export const readDirectory: typeof IO.readDirectory = (path, extension, exclude, include, depth) => ts.sys.readDirectory(path, extension, exclude, include, depth); + function filesInFolder(folder: string): string[] { + let paths: string[] = []; - export function createDirectory(path: string) { - if (!directoryExists(path)) { - fs.mkdirSync(path); - } - } - - export function deleteFile(path: string) { - try { - fs.unlinkSync(path); - } - catch (e) { + const files = fs.readdirSync(folder); + for (let i = 0; i < files.length; i++) { + const pathToFile = pathModule.join(folder, files[i]); + const stat = fs.statSync(pathToFile); + if (options.recursive && stat.isDirectory()) { + paths = paths.concat(filesInFolder(pathToFile)); + } + else if (stat.isFile() && (!spec || files[i].match(spec))) { + paths.push(pathToFile); + } } - } - - export function directoryExists(path: string): boolean { - return fs.existsSync(path) && fs.statSync(path).isDirectory(); - } - export function directoryName(path: string) { - const dirPath = pathModule.dirname(path); - // Node will just continue to repeat the root path, rather than return null - return dirPath === path ? undefined : dirPath; + return paths; } - export let listFiles: typeof IO.listFiles = (path, spec?, options?) => { - options = options || {}; - - function filesInFolder(folder: string): string[] { - let paths: string[] = []; + return filesInFolder(path); + } - const files = fs.readdirSync(folder); - for (let i = 0; i < files.length; i++) { - const pathToFile = pathModule.join(folder, files[i]); - const stat = fs.statSync(pathToFile); - if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(pathToFile)); + function getAccessibleFileSystemEntries(dirname: string): FileSystemEntries { + try { + const entries: string[] = fs.readdirSync(dirname || ".").sort(ts.sys.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); + const files: string[] = []; + const directories: string[] = []; + for (const entry of entries) { + if (entry === "." || entry === "..") continue; + const name = vpath.combine(dirname, entry); + try { + const stat = fs.statSync(name); + if (!stat) continue; + if (stat.isFile()) { + files.push(entry); } - else if (stat.isFile() && (!spec || files[i].match(spec))) { - paths.push(pathToFile); + else if (stat.isDirectory()) { + directories.push(entry); } } - - return paths; - } - - return filesInFolder(path); - }; - - export let getMemoryUsage: typeof IO.getMemoryUsage = () => { - if (global.gc) { - global.gc(); + catch (e) { } } - return process.memoryUsage().heapUsed; - }; + return { files, directories }; + } + catch (e) { + return { files: [], directories: [] }; + } } - export namespace Network { - const serverRoot = "http://localhost:8888/"; - - export const newLine = () => harnessNewLine; - export const useCaseSensitiveFileNames = () => false; - export const getCurrentDirectory = () => ""; - export const args = () => []; - export const getExecutingFilePath = () => ""; - export const exit = ts.noop; - export const getDirectories = () => []; + return { + newLine: () => harnessNewLine, + getCurrentDirectory: () => ts.sys.getCurrentDirectory(), + useCaseSensitiveFileNames: () => ts.sys.useCaseSensitiveFileNames, + resolvePath: (path: string) => ts.sys.resolvePath(path), + readFile: path => ts.sys.readFile(path), + writeFile: (path, content) => ts.sys.writeFile(path, content), + directoryName, + getDirectories: path => ts.sys.getDirectories(path), + createDirectory: path => ts.sys.createDirectory(path), + fileExists: path => ts.sys.fileExists(path), + directoryExists: path => ts.sys.directoryExists(path), + deleteFile, + listFiles, + log: s => console.log(s), + args: () => ts.sys.args, + getExecutingFilePath: () => ts.sys.getExecutingFilePath(), + exit: exitCode => ts.sys.exit(exitCode), + readDirectory: (path, extension, exclude, include, depth) => ts.sys.readDirectory(path, extension, exclude, include, depth), + getAccessibleFileSystemEntries, + tryEnableSourceMapsForHost: () => ts.sys.tryEnableSourceMapsForHost && ts.sys.tryEnableSourceMapsForHost(), + getMemoryUsage: () => ts.sys.getMemoryUsage && ts.sys.getMemoryUsage(), + getEnvironmentVariable: name => ts.sys.getEnvironmentVariable(name), + }; + } - export let log = (s: string) => console.log(s); + interface URL { + hash: string; + host: string; + hostname: string; + href: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + username: string; + toString(): string; + } - namespace Http { - function waitForXHR(xhr: XMLHttpRequest) { - while (xhr.readyState !== 4) { } - return { status: xhr.status, responseText: xhr.responseText }; - } + declare var URL: { + prototype: URL; + new(url: string, base?: string | URL): URL; + }; - /// Ask the server to use node's path.resolve to resolve the given path + function createBrowserIO(): IO { + const serverRoot = new URL("http://localhost:8888/"); - export interface XHRResponse { - status: number; - responseText: string; - } + interface HttpHeaders { + [key: string]: string | string[] | undefined; + } - /// Ask the server for the contents of the file at the given URL via a simple GET request - export function getFileFromServerSync(url: string): XHRResponse { - const xhr = new XMLHttpRequest(); - try { - xhr.open("GET", url, /*async*/ false); - xhr.send(); - } - catch (e) { - return { status: 404, responseText: undefined }; + const HttpHeaders = { + combine(left: HttpHeaders | undefined, right: HttpHeaders | undefined): HttpHeaders { + return left && right ? { ...left, ...right } : + left ? { ...left } : + right ? { ...right } : + {}; + }, + writeRequestHeaders(xhr: XMLHttpRequest, headers: HttpHeaders) { + for (const key in headers) { + if (!headers.hasOwnProperty(key)) continue; + const keyLower = key.toLowerCase(); + + if (keyLower === "access-control-allow-origin" || keyLower === "content-length") continue; + const values = headers[key]; + const value = Array.isArray(values) ? values.join(",") : values; + if (keyLower === "content-type") { + xhr.overrideMimeType(value); + continue; } - return waitForXHR(xhr); + xhr.setRequestHeader(key, value); } - - /// Submit a POST request to the server to do the given action (ex WRITE, DELETE) on the provided URL - export function writeToServerSync(url: string, action: string, contents?: string): XHRResponse { - const xhr = new XMLHttpRequest(); - try { - const actionMsg = "?action=" + action; - xhr.open("POST", url + actionMsg, /*async*/ false); - xhr.setRequestHeader("Access-Control-Allow-Origin", "*"); - xhr.send(contents); - } - catch (e) { - log(`XHR Error: ${e}`); - return { status: 500, responseText: undefined }; + }, + readResponseHeaders(xhr: XMLHttpRequest): HttpHeaders { + const allHeaders = xhr.getAllResponseHeaders(); + const headers: HttpHeaders = {}; + for (const header of allHeaders.split(/\r\n/g)) { + const colonIndex = header.indexOf(":"); + if (colonIndex >= 0) { + const key = header.slice(0, colonIndex).trim(); + const value = header.slice(colonIndex + 1).trim(); + const values = value.split(","); + headers[key] = values.length > 1 ? values : value; } - - return waitForXHR(xhr); } + return headers; } + }; - export function createDirectory() { - // Do nothing (?) - } + interface HttpContent { + headers: HttpHeaders; + content: string; + } - export function deleteFile(path: string) { - Http.writeToServerSync(serverRoot + path, "DELETE"); + const HttpContent = { + create(headers: HttpHeaders, content: string): HttpContent { + return { headers, content }; + }, + fromMediaType(mediaType: string, content: string) { + return HttpContent.create({ "Content-Type": mediaType }, content); + }, + text(content: string) { + return HttpContent.fromMediaType("text/plain", content); + }, + json(content: object) { + return HttpContent.fromMediaType("application/json", JSON.stringify(content)); + }, + readResponseContent(xhr: XMLHttpRequest) { + if (typeof xhr.responseText === "string") { + return HttpContent.create({ + "Content-Type": xhr.getResponseHeader("Content-Type") || undefined, + "Content-Length": xhr.getResponseHeader("Content-Length") || undefined + }, xhr.responseText); + } + return undefined; } + }; - export function directoryExists(): boolean { - return false; - } + interface HttpRequestMessage { + method: string; + url: URL; + headers: HttpHeaders; + content?: HttpContent; + } - function directoryNameImpl(path: string) { - let dirPath = path; - // root of the server - if (dirPath.match(/localhost:\d+$/) || dirPath.match(/localhost:\d+\/$/)) { - dirPath = undefined; - // path + fileName - } - else if (dirPath.indexOf(".") === -1) { - dirPath = dirPath.substring(0, dirPath.lastIndexOf("/")); - // path - } - else { - // strip any trailing slash - if (dirPath.match(/.*\/$/)) { - dirPath = dirPath.substring(0, dirPath.length - 2); - } - dirPath = dirPath.substring(0, dirPath.lastIndexOf("/")); - } + const HttpRequestMessage = { + create(method: string, url: string | URL, headers: HttpHeaders = {}, content?: HttpContent): HttpRequestMessage { + if (typeof url === "string") url = new URL(url); + return { method, url, headers, content }; + }, + options(url: string | URL) { + return HttpRequestMessage.create("OPTIONS", url); + }, + head(url: string | URL) { + return HttpRequestMessage.create("HEAD", url); + }, + get(url: string | URL) { + return HttpRequestMessage.create("GET", url); + }, + delete(url: string | URL) { + return HttpRequestMessage.create("DELETE", url); + }, + put(url: string | URL, content: HttpContent) { + return HttpRequestMessage.create("PUT", url, {}, content); + }, + post(url: string | URL, content: HttpContent) { + return HttpRequestMessage.create("POST", url, {}, content); + }, + }; + + interface HttpResponseMessage { + statusCode: number; + statusMessage: string; + headers: HttpHeaders; + content?: HttpContent; + } - return dirPath; + const HttpResponseMessage = { + create(statusCode: number, statusMessage: string, headers: HttpHeaders = {}, content?: HttpContent): HttpResponseMessage { + return { statusCode, statusMessage, headers, content }; + }, + notFound(): HttpResponseMessage { + return HttpResponseMessage.create(404, "Not Found"); + }, + hasSuccessStatusCode(response: HttpResponseMessage) { + return response.statusCode === 304 || (response.statusCode >= 200 && response.statusCode < 300); + }, + readResponseMessage(xhr: XMLHttpRequest) { + return HttpResponseMessage.create( + xhr.status, + xhr.statusText, + HttpHeaders.readResponseHeaders(xhr), + HttpContent.readResponseContent(xhr)); } - export let directoryName: typeof IO.directoryName = Utils.memoize(directoryNameImpl, path => path); + }; - export function resolvePath(path: string) { - const response = Http.getFileFromServerSync(serverRoot + path + "?resolve=true"); - if (response.status === 200) { - return response.responseText; - } - else { - return undefined; - } + function send(request: HttpRequestMessage): HttpResponseMessage { + const xhr = new XMLHttpRequest(); + try { + HttpHeaders.writeRequestHeaders(xhr, request.headers); + HttpHeaders.writeRequestHeaders(xhr, request.content && request.content.headers); + xhr.setRequestHeader("Access-Control-Allow-Origin", "*"); + xhr.open(request.method, request.url.toString(), /*async*/ false); + xhr.send(request.content && request.content.content); + while (xhr.readyState !== 4); // block until ready + return HttpResponseMessage.readResponseMessage(xhr); + } + catch (e) { + return HttpResponseMessage.notFound(); } + } - export function fileExists(path: string): boolean { - const response = Http.getFileFromServerSync(serverRoot + path); - return response.status === 200; + let caseSensitivity: "CI" | "CS" | undefined; + + function useCaseSensitiveFileNames() { + if (!caseSensitivity) { + const response = send(HttpRequestMessage.options(new URL("*", serverRoot))); + const xCaseSensitivity = response.headers["X-Case-Sensitivity"]; + caseSensitivity = xCaseSensitivity === "CS" ? "CS" : "CI"; } + return caseSensitivity === "CS"; + } - export const listFiles = Utils.memoize((path: string, spec?: RegExp, options?: { recursive?: boolean }): string[] => { - const response = Http.getFileFromServerSync(serverRoot + path); - if (response.status === 200) { - let results = response.responseText.split(","); - if (spec) { - results = results.filter(file => spec.test(file)); - } - if (options && !options.recursive) { - results = results.filter(file => (ts.getDirectoryPath(ts.normalizeSlashes(file)) === path)); - } - return results; - } - else { - return [""]; - } - }, (path: string, spec?: RegExp, options?: { recursive?: boolean }) => `${path}|${spec}|${options ? options.recursive : undefined}`); + function resolvePath(path: string) { + const response = send(HttpRequestMessage.post(new URL("/api/resolve", serverRoot), HttpContent.text(path))); + return HttpResponseMessage.hasSuccessStatusCode(response) && response.content ? response.content.content : undefined; + } + + function readFile(path: string): string | undefined { + const response = send(HttpRequestMessage.get(new URL(path, serverRoot))); + return HttpResponseMessage.hasSuccessStatusCode(response) && response.content ? response.content.content : undefined; + } - export function readFile(file: string): string | undefined { - const response = Http.getFileFromServerSync(serverRoot + file); - if (response.status === 200) { - return response.responseText; + function writeFile(path: string, contents: string) { + send(HttpRequestMessage.put(new URL(path, serverRoot), HttpContent.text(contents))); + } + + function fileExists(path: string): boolean { + const response = send(HttpRequestMessage.head(new URL(path, serverRoot))); + return HttpResponseMessage.hasSuccessStatusCode(response); + } + + function directoryExists(path: string): boolean { + const response = send(HttpRequestMessage.post(new URL("/api/directoryExists", serverRoot), HttpContent.text(path))); + return HttpResponseMessage.hasSuccessStatusCode(response) + && (response.content && response.content.content) === "true"; + } + + function deleteFile(path: string) { + send(HttpRequestMessage.delete(new URL(path, serverRoot))); + } + + function directoryName(path: string) { + const url = new URL(path, serverRoot); + return ts.getDirectoryPath(ts.normalizeSlashes(url.pathname || "/")); + } + + function listFiles(dirname: string, spec?: RegExp, options?: { recursive?: boolean }): string[] { + if (spec || (options && !options.recursive)) { + let results = IO.listFiles(dirname); + if (spec) { + results = results.filter(file => spec.test(file)); } - else { - return undefined; + if (options && !options.recursive) { + results = results.filter(file => ts.getDirectoryPath(ts.normalizeSlashes(file)) === dirname); } + return results; } - export function writeFile(path: string, contents: string) { - Http.writeToServerSync(serverRoot + path, "WRITE", contents); - } + const response = send(HttpRequestMessage.post(new URL("/api/listFiles", serverRoot), HttpContent.text(dirname))); + return HttpResponseMessage.hasSuccessStatusCode(response) + && response.content + && response.content.headers["Content-Type"] === "application/json" + ? JSON.parse(response.content.content) + : []; + } - export function readDirectory(path: string, extension?: string[], exclude?: string[], include?: string[], depth?: number) { - const fs = new Utils.VirtualFileSystem(path, useCaseSensitiveFileNames()); - for (const file of listFiles(path)) { - fs.addFile(file); - } - return ts.matchFiles(path, extension, exclude, include, useCaseSensitiveFileNames(), getCurrentDirectory(), depth, path => { - const entry = fs.getEntry(path); - if (entry instanceof Utils.VirtualDirectory) { - const directory = entry; - return { - files: ts.map(directory.getFiles(), f => f.name), - directories: ts.map(directory.getDirectories(), d => d.name) - }; - } - return { files: [], directories: [] }; - }); - } + function readDirectory(path: string, extension?: string[], exclude?: string[], include?: string[], depth?: number) { + const fs = new vfs.VirtualFileSystem(path, useCaseSensitiveFileNames()); + fs.addFiles(IO.listFiles(path)); + return ts.matchFiles(path, extension, exclude, include, useCaseSensitiveFileNames(), /*currentDirectory*/ "", depth, path => getAccessibleVirtualFileSystemEntries(fs, path)); + } + + function getAccessibleFileSystemEntries(dirname: string): FileSystemEntries { + const fs = new vfs.VirtualFileSystem(dirname, useCaseSensitiveFileNames()); + fs.addFiles(IO.listFiles(dirname)); + return getAccessibleVirtualFileSystemEntries(fs, dirname); + } + + function getAccessibleVirtualFileSystemEntries(fs: vfs.VirtualFileSystem, dirname: string): FileSystemEntries { + const directory = fs.getDirectory(dirname); + return directory + ? { files: directory.getFileNames(), directories: directory.getDirectoryNames() } + : { files: [], directories: [] }; } + + return { + newLine: () => harnessNewLine, + getCurrentDirectory: () => "", + useCaseSensitiveFileNames, + resolvePath, + readFile, + writeFile, + directoryName: Utils.memoize(directoryName, path => path), + getDirectories: () => [], + createDirectory: () => {}, + fileExists, + directoryExists, + deleteFile, + listFiles: Utils.memoize(listFiles, (path, spec, options) => `${path}|${spec}|${options ? options.recursive === true : true}`), + log: s => console.log(s), + args: () => [], + getExecutingFilePath: () => "", + exit: () => {}, + readDirectory, + getAccessibleFileSystemEntries + }; } export function mockHash(s: string): string { @@ -764,10 +901,10 @@ namespace Harness { const environment = Utils.getExecutionEnvironment(); switch (environment) { case Utils.ExecutionEnvironment.Node: - IO = IOImpl.Node; + IO = createNodeIO(); break; case Utils.ExecutionEnvironment.Browser: - IO = IOImpl.Network; + IO = createBrowserIO(); break; default: throw new Error(`Unknown value '${environment}' for ExecutionEnvironment.`); diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 9e353a1435133..ebfd9b9b02b83 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -123,7 +123,7 @@ namespace Harness.LanguageService { } export class LanguageServiceAdapterHost { - protected virtualFileSystem: Utils.VirtualFileSystem = new Utils.VirtualFileSystem(virtualFileSystemRoot, /*useCaseSensitiveFilenames*/ false); + protected virtualFileSystem: vfs.VirtualFileSystem = new vfs.VirtualFileSystem(virtualFileSystemRoot, /*useCaseSensitiveFilenames*/ false); constructor(protected cancellationToken = DefaultHostCancellationToken.Instance, protected settings = ts.getDefaultCompilerOptions()) { @@ -135,8 +135,8 @@ namespace Harness.LanguageService { public getFilenames(): string[] { const fileNames: string[] = []; - for (const virtualEntry of this.virtualFileSystem.getFiles({ recursive: true })) { - const scriptInfo = virtualEntry.metadata.get("scriptInfo"); + for (const virtualEntry of this.virtualFileSystem.getDirectory("/").getFiles({ recursive: true })) { + const scriptInfo = virtualEntry.metadata.get("scriptInfo") as ScriptInfo; if (scriptInfo && scriptInfo.isRootFile) { // only include root files here // usually it means that we won't include lib.d.ts in the list of root files so it won't mess the computation of compilation root dir. @@ -160,7 +160,7 @@ namespace Harness.LanguageService { const script = file && file.metadata.get("scriptInfo") as ScriptInfo; if (script) { script.editContent(start, end, newText); - file.setContent(script.content); + file.content = script.content; return; } diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 2838ba5b0c453..dd8719a1bee99 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -99,6 +99,7 @@ "runner.ts", "collections.ts", "vpath.ts", + "events.ts", "vfs.ts", "virtualFileSystemWithWatch.ts", "../server/protocol.ts", diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index bd33e632d6fa9..42ac54b076f6d 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -1,105 +1,98 @@ /// /// /// +/// /// -namespace Utils { - import compareStrings = Collections.compareStrings; - import removeAt = ts.orderedRemoveItemAt; - import KeyedCollection = Collections.KeyedCollection; - import Metadata = Collections.Metadata; - - // import IO = Harness.IO; - - // export interface PathMappings { - // [path: string]: string; - // } - - // export interface FileSystemResolver { - // getEntries(dir: VirtualDirectory): { files: string[], directories: string[] }; - // getContent(file: VirtualFile): string | undefined; - // } - - // function createMapper(ignoreCase: boolean, map: PathMappings | undefined) { - // if (!map) return identity; - // const roots = Object.keys(map); - // const patterns = roots.map(root => createPattern(root, ignoreCase)); - // return function (path: string) { - // for (let i = 0; i < patterns.length; i++) { - // const match = patterns[i].exec(path); - // if (match) { - // const prefix = path.slice(0, match.index); - // const suffix = path.slice(match.index + match[0].length); - // return vpath.combine(prefix, map[roots[i]], suffix); - // } - // } - // return path; - // }; - // } - - // function createPattern(path: string, ignoreCase: boolean) { - // path = vpath.normalizeSlashes(path); - // const components = vpath.parse(path); - // let pattern = ""; - // for (let i = 1; i < components.length; i++) { - // const component = components[i]; - // if (pattern) pattern += "/"; - // pattern += escapeRegExp(component); - // } - // pattern = (components[0] ? "^" + escapeRegExp(components[0]) : "/") + pattern + "(/|$)"; - // return new RegExp(pattern, ignoreCase ? "i" : ""); - // } - - // export function createResolver(io: IO, map?: PathMappings): FileSystemResolver { - // const mapper = createMapper(!io.useCaseSensitiveFileNames(), map); - // return { - // getEntries(dir) { - // return io.getAccessibleFileSystemEntries(mapper(dir.path)); - // }, - // getContent(file) { - // return io.readFile(mapper(file.path)); - // } - // }; - // } - - export type FindAxis = "ancestors" | "ancestors-or-self" | "self" | "descendents-or-self" | "descendents"; - - export abstract class VirtualFileSystemEntry { - private _readonly = false; - private _path: string; - private _metadata: Metadata; +namespace vfs { + import compareStrings = collections.compareStrings; + import KeyedCollection = collections.SortedCollection; + import Metadata = collections.Metadata; + import EventEmitter = events.EventEmitter; + import IO = Harness.IO; + + export interface PathMappings { + [path: string]: string; + } - /** - * Gets the name of this entry. - */ - public readonly name: string; + export interface FileSystemResolver { + getEntries(dir: VirtualDirectory): { files: string[], directories: string[] }; + getContent(file: VirtualFile): string | undefined; + } - constructor(name: string) { - this.name = name; - } + export type ContentResolver = FileSystemResolver["getContent"]; + + function identityMapper(path: string) { return path; } + + function createMapper(ignoreCase: boolean, map: PathMappings | undefined) { + if (!map) return identityMapper; + const roots = Object.keys(map); + const patterns = roots.map(root => createPattern(root, ignoreCase)); + return function (path: string) { + for (let i = 0; i < patterns.length; i++) { + const match = patterns[i].exec(path); + if (match) { + const prefix = path.slice(0, match.index); + const suffix = path.slice(match.index + match[0].length); + return vpath.combine(prefix, map[roots[i]], suffix); + } + } + return path; + }; + } - /** - * Gets the file system to which this entry belongs. - */ - public get fileSystem(): VirtualFileSystem { - return this.parent.fileSystem; - } + const reservedCharacterRegExp = /[^\w\s\/]/g; - /** - * Gets the container for this entry. - */ - public abstract get parent(): VirtualFileSystemContainer; + function escapeRegExp(pattern: string) { + return pattern.replace(reservedCharacterRegExp, match => "\\" + match); + } - /** - * Gets the entry that this entry shadows. - */ - public abstract get shadowRoot(): VirtualFileSystemEntry | undefined; + function createPattern(path: string, ignoreCase: boolean) { + path = vpath.normalizeSeparators(path); + const components = vpath.parse(path); + let pattern = ""; + for (let i = 1; i < components.length; i++) { + const component = components[i]; + if (pattern) pattern += "/"; + pattern += escapeRegExp(component); + } + pattern = (components[0] ? "^" + escapeRegExp(components[0]) : "/") + pattern + "(/|$)"; + return new RegExp(pattern, ignoreCase ? "i" : ""); + } - /** - * Gets metadata about this entry. - */ - public get metadata(): Metadata { - return this._metadata || (this._metadata = new Metadata(this.shadowRoot ? this.shadowRoot.metadata : undefined)); - } + export function createResolver(io: IO, map?: PathMappings): FileSystemResolver { + const mapper = createMapper(!io.useCaseSensitiveFileNames(), map); + return { + getEntries(dir) { + return io.getAccessibleFileSystemEntries(mapper(dir.path)); + }, + getContent(file) { + return io.readFile(mapper(file.path)); + } + }; + } + + export type Axis = "ancestors" | "ancestors-or-self" | "self" | "descendents-or-self" | "descendents"; + export type FileSystemChange = "added" | "modified" | "removed"; + export type VirtualEntry = VirtualFile | VirtualDirectory; + export type VirtualSymlink = VirtualFileSymlink | VirtualDirectorySymlink; + + type VirtualEntryView = VirtualFileView | VirtualDirectoryView; + + interface FileWatcherEntry { + watcher: (path: string, change: FileSystemChange) => void; + } + + interface DirectoryWatcherEntryArray extends Array { + recursiveCount?: number; + } + + interface DirectoryWatcherEntry { + watcher: (path: string) => void; + recursive: boolean; + } + + export abstract class VirtualFileSystemObject extends EventEmitter { + private _readonly = false; /** * Gets a value indicating whether this entry is read-only. @@ -108,329 +101,122 @@ namespace Utils { return this._readonly; } - public get path(): string { - return this._path || (this._path = vpath.combine(this.parent.path, this.name)); - } - - public get relative(): string { - return this.relativeTo(this.fileSystem.currentDirectory); - } - - public get exists(): boolean { - return this.parent.exists - && this.parent.getEntry(this.name) as VirtualFileSystemEntry === this; - } - public makeReadOnly(): void { this.makeReadOnlyCore(); this._readonly = true; } - public relativeTo(other: string | VirtualFileSystemEntry) { - if (other) { - const otherPath = typeof other === "string" ? other : other.path; - const ignoreCase = !this.fileSystem.useCaseSensitiveFileNames; - return vpath.relative(otherPath, this.path, ignoreCase); - } - return this.path; - } - - /** - * Creates a file system entry that shadows this file system entry. - * @param parent The container for the shadowed entry. - */ - public abstract shadow(parent: VirtualFileSystemContainer): VirtualFileSystemEntry; - protected abstract makeReadOnlyCore(): void; protected writePreamble(): void { if (this._readonly) throw new Error("Cannot modify a frozen entry."); } - - protected shadowPreamble(parent: VirtualFileSystemContainer): void { - if (this.parent !== parent.shadowRoot) throw new Error("Incorrect shadow parent"); - let fileSystem: VirtualFileSystem | undefined = this.fileSystem; - while (fileSystem) { - if (parent.fileSystem === fileSystem) throw new Error("Cannot create shadow for parent in the same file system."); - fileSystem = fileSystem.shadowRoot; - } - } - } - - export abstract class VirtualFileSystemContainer extends VirtualFileSystemEntry { - private _childAddedCallbacks: ((entry: VirtualFile | VirtualDirectory) => void)[]; - private _childRemovedCallbacks: ((entry: VirtualFile | VirtualDirectory) => void)[]; - - public abstract get shadowRoot(): VirtualFileSystemContainer | undefined; - - public addOnChildAdded(callback: (entry: VirtualFile | VirtualDirectory) => void) { - if (!this._childAddedCallbacks) { - this._childAddedCallbacks = [callback]; - } - else if (this._childAddedCallbacks.indexOf(callback) === -1) { - this._childAddedCallbacks.push(callback); - } - } - - public removeOnChildAdded(callback: (entry: VirtualFile | VirtualDirectory) => void) { - if (this._childAddedCallbacks) { - const index = this._childAddedCallbacks.indexOf(callback); - if (index >= 0) removeAt(this._childAddedCallbacks, index); - } - } - - public addOnChildRemoved(callback: (entry: VirtualFile | VirtualDirectory) => void) { - if (!this._childRemovedCallbacks) { - this._childRemovedCallbacks = [callback]; - } - else if (this._childRemovedCallbacks.indexOf(callback) === -1) { - this._childRemovedCallbacks.push(callback); - } - } - - public removeOnChildRemoved(callback: (entry: VirtualFile | VirtualDirectory) => void) { - if (this._childRemovedCallbacks) { - const index = this._childRemovedCallbacks.indexOf(callback); - if (index >= 0) removeAt(this._childRemovedCallbacks, index); - } - } - - public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile[]; - public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory[]; - public getEntries(options?: { recursive?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): (VirtualFile | VirtualDirectory)[]; - public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): (VirtualFile | VirtualDirectory)[] { - const results: (VirtualFile | VirtualDirectory)[] = []; - if (options.recursive) { - this.getOwnEntries().forEach(entry => { - if (entry instanceof VirtualFile) { - if (isMatch(entry, options)) { - results.push(entry); - } - } - else if (entry instanceof VirtualDirectory) { - if (isMatch(entry, options)) { - results.push(entry); - } - for (const child of entry.getEntries(options)) { - results.push(child); - } - } - }); - } - else { - this.getOwnEntries().forEach(entry => { - if (isMatch(entry, options)) { - results.push(entry); - } - }); - } - return results; - } - - public getDirectories(options: { recursive?: boolean, pattern?: RegExp } = {}): VirtualDirectory[] { - return this.getEntries({ ...options, kind: "directory" }); - } - - public getFiles(options: { recursive?: boolean, pattern?: RegExp } = {}): VirtualFile[] { - return this.getEntries({ ...options, kind: "file" }); - } - - public getEntryNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): string[] { - return this.getEntries(options).map(entry => - options && options.qualified ? entry.path : - options && options.recursive ? entry.relativeTo(this) : - entry.name); - } - - public getDirectoryNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp } = {}): string[] { - return this.getEntryNames({ ...options, kind: "directory" }); - } - - public getFileNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp } = {}): string[] { - return this.getEntryNames({ ...options, kind: "file" }); - } - - public abstract getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; - public abstract getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; - public abstract getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; - - public getDirectory(path: string, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualDirectory | undefined { - return this.getEntry(path, { ...options, kind: "directory" }); - } - - public getFile(path: string, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualFile | undefined { - return this.getEntry(path, { ...options, kind: "file" }); - } - - public findEntry(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; - public findEntry(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; - public findEntry(path: string, axis: FindAxis, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; - public findEntry(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualFile | VirtualDirectory | undefined { - const walkAncestors = axis === "ancestors-or-self" || axis === "ancestors"; - const walkDescendents = axis === "descendents-or-self" || axis === "descendents"; - const walkSelf = axis === "ancestors-or-self" || axis === "self" || axis === "descendents-or-self"; - if (walkSelf) { - const entry = this.getEntry(path, options); - if (entry) return entry; - } - if (walkAncestors) { - const entry = !(this instanceof VirtualFileSystem) && this.parent.findEntry(path, "ancestors-or-self", options); - if (entry) return entry; - } - if (walkDescendents) { - for (const child of this.getDirectories()) { - const entry = child.findEntry(path, "descendents-or-self", options); - if (entry) return entry; - } - } - } - - public findDirectory(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualDirectory | undefined { - return this.findEntry(path, axis, { ...options, kind: "directory" }); - } - - public findFile(path: string, axis: FindAxis, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualFile | undefined { - return this.findEntry(path, axis, { ...options, kind: "file" }); - } - - protected abstract getOwnEntries(): KeyedCollection; - - protected raiseOnChildAdded(entry: VirtualFile | VirtualDirectory) { - if (this._childAddedCallbacks) { - for (const callback of this._childAddedCallbacks) { - callback(entry); - } - } - } - - protected raiseOnChildRemoved(entry: VirtualFile | VirtualDirectory) { - if (this._childRemovedCallbacks) { - for (const callback of this._childRemovedCallbacks) { - callback(entry); - } - } - } } - export class VirtualFileSystem extends VirtualFileSystemContainer { - // private static _builtLocal: VirtualFileSystem | undefined; - // private static _builtLocalCI: VirtualFileSystem | undefined; - // private static _builtLocalCS: VirtualFileSystem | undefined; + export class VirtualFileSystem extends VirtualFileSystemObject { + private static _builtLocal: VirtualFileSystem | undefined; + private static _builtLocalCI: VirtualFileSystem | undefined; + private static _builtLocalCS: VirtualFileSystem | undefined; - private _root: VirtualDirectory; + private _root: VirtualRoot; private _useCaseSensitiveFileNames: boolean; private _currentDirectory: string; private _currentDirectoryStack: string[] | undefined; private _shadowRoot: VirtualFileSystem | undefined; + private _watchedFiles: KeyedCollection | undefined; + private _watchedDirectories: KeyedCollection | undefined; + private _onRootFileSystemChange: (path: string, change: FileSystemChange) => void; constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean) { - super(""); + super(); this._currentDirectory = currentDirectory.replace(/\\/g, "/"); this._useCaseSensitiveFileNames = useCaseSensitiveFileNames; + this._onRootFileSystemChange = (path, change) => this.onRootFileSystemChange(path, change); } - public get fileSystem(): VirtualFileSystem { - return this; - } - - public get parent(): VirtualFileSystemContainer { - return this; - } - + /** + * Gets the file system shadowed by this instance. + */ public get shadowRoot(): VirtualFileSystem | undefined { return this._shadowRoot; } + /** + * Gets a value indicating whether to use case sensitive file names. + */ public get useCaseSensitiveFileNames() { return this._useCaseSensitiveFileNames; } + /** + * Gets the path to the current directory. + */ public get currentDirectory() { return this._currentDirectory; } - public get path() { - return ""; - } - - public get relative() { - return ""; - } - - public get exists() { - return true; - } - - public get root() { + private get root(): VirtualRoot { if (this._root === undefined) { if (this._shadowRoot) { - this._root = this._shadowRoot.root.shadow(this); + this._root = this._shadowRoot.root._shadow(this); } else { - this._root = new VirtualDirectory(this, ""); + this._root = new VirtualRoot(this); } + this._root.addListener("fileSystemChange", this._onRootFileSystemChange); if (this.isReadOnly) this._root.makeReadOnly(); } return this._root; } - // public static getBuiltLocal(useCaseSensitiveFileNames: boolean = io.useCaseSensitiveFileNames()): VirtualFileSystem { - // let vfs = useCaseSensitiveFileNames ? this._builtLocalCS : this._builtLocalCI; - // if (!vfs) { - // vfs = this._builtLocal; - // if (!vfs) { - // const resolver = createResolver(io, { - // "/.ts": getBuiltDirectory(), - // "/.lib": getLibFilesDirectory() - // }); - // vfs = new VirtualFileSystem("/", io.useCaseSensitiveFileNames()); - // vfs.addDirectory("/.ts", resolver); - // vfs.addDirectory("/.lib", resolver); - // vfs.addDirectory("/.test"); - // vfs.changeDirectory("/.test"); - // vfs.makeReadOnly(); - // this._builtLocal = vfs; - // } - // if (vfs._useCaseSensitiveFileNames !== useCaseSensitiveFileNames) { - // vfs = vfs.shadow(); - // vfs._useCaseSensitiveFileNames = useCaseSensitiveFileNames; - // vfs.makeReadOnly(); - // } - // return useCaseSensitiveFileNames - // ? this._builtLocalCS = vfs - // : this._builtLocalCI = vfs; - // } - // return vfs; - // } - - // public static createFromOptions(options: { useCaseSensitiveFileNames?: boolean, currentDirectory?: string }) { - // const vfs = this.getBuiltLocal(options.useCaseSensitiveFileNames).shadow(); - // if (options.currentDirectory) { - // vfs.addDirectory(options.currentDirectory); - // vfs.changeDirectory(options.currentDirectory); - // } - // return vfs; - // } - - // public static createFromDocuments(options: { useCaseSensitiveFileNames?: boolean, currentDirectory?: string }, documents: TextDocument[], fileOptions?: { overwrite?: boolean }) { - // const vfs = this.createFromOptions(options); - // for (const document of documents) { - // const file = vfs.addFile(document.file, document.text, fileOptions)!; - // assert.isDefined(file, `Failed to add file: '${document.file}'`); - // file.metadata.set("document", document); - // // Add symlinks - // const symlink = document.meta.get("symlink"); - // if (file && symlink) { - // for (const link of symlink.split(",")) { - // const symlink = vfs.addSymlink(vpath.resolve(vfs.currentDirectory, link.trim()), file)!; - // assert.isDefined(symlink, `Failed to symlink: '${link}'`); - // symlink.metadata.set("document", document); - // } - // } - // } - // return vfs; - // } + /** + * Gets a virtual file system with the following entries: + * + * | path | physical/virtual | + * |:-------|:----------------------| + * | /.ts | physical: built/local | + * | /.lib | physical: tests/lib | + * | /.test | virtual | + */ + public static getBuiltLocal(useCaseSensitiveFileNames: boolean = IO.useCaseSensitiveFileNames()): VirtualFileSystem { + let vfs = useCaseSensitiveFileNames ? this._builtLocalCS : this._builtLocalCI; + if (!vfs) { + vfs = this._builtLocal; + if (!vfs) { + const resolver = createResolver(IO, { + "/.ts": __dirname, + "/.lib": vpath.resolve(__dirname, "../../tests/lib") + }); + vfs = new VirtualFileSystem("/", IO.useCaseSensitiveFileNames()); + vfs.addDirectory("/.ts", resolver); + vfs.addDirectory("/.lib", resolver); + vfs.addDirectory("/.test"); + vfs.changeDirectory("/.test"); + vfs.makeReadOnly(); + this._builtLocal = vfs; + } + if (vfs._useCaseSensitiveFileNames !== useCaseSensitiveFileNames) { + vfs = vfs.shadow(); + vfs._useCaseSensitiveFileNames = useCaseSensitiveFileNames; + vfs.makeReadOnly(); + } + return useCaseSensitiveFileNames + ? this._builtLocalCS = vfs + : this._builtLocalCI = vfs; + } + return vfs; + } + + /** + * Gets a value indicating whether to file names are equivalent for the file system's case sensitivity. + */ + public sameName(a: string, b: string) { + return compareStrings(a, b, !this.useCaseSensitiveFileNames) === 0; + } + /** + * Changes the current directory to the supplied path. + */ public changeDirectory(path: string) { this.writePreamble(); if (path) { @@ -438,6 +224,9 @@ namespace Utils { } } + /** + * Pushes the current directory onto the location stack and changes the current directory to the supplied path. + */ public pushDirectory(path = this.currentDirectory) { this.writePreamble(); if (this._currentDirectoryStack === undefined) { @@ -449,6 +238,9 @@ namespace Utils { this.changeDirectory(path); } + /** + * Pops the previous directory from the location stack and changes the current directory to that directory. + */ public popDirectory() { this.writePreamble(); const previousDirectory = this._currentDirectoryStack && this._currentDirectoryStack.pop(); @@ -457,80 +249,145 @@ namespace Utils { } } - public addDirectory(path: string /*, resolver?: FileSystemResolver */) { - return this.root.addDirectory(vpath.resolve(this.currentDirectory, path) /*, resolver */); + /** + * Adds a directory (and all intermediate directories) to a path relative to the current directory. + */ + public addDirectory(path: string, resolver?: FileSystemResolver) { + return this.root.addDirectory(vpath.resolve(this.currentDirectory, path), resolver); } - public addFile(path: string, content?: /*FileSystemResolver["getContent"] |*/ string, options?: { overwrite?: boolean }) { + /** + * Adds a file (and all intermediate directories) to a path relative to the current directory. + */ + public addFile(path: string, content?: FileSystemResolver | ContentResolver | string, options?: { overwrite?: boolean }) { return this.root.addFile(vpath.resolve(this.currentDirectory, path), content, options); } + /** + * Adds multiple files (and all intermediate directories) to paths relative to the current directory. + */ + public addFiles(files: string[]) { + for (const file of files) { + this.addFile(file); + } + } + + /** + * Adds a symbolic link to a target entry for a path relative to the current directory. + */ public addSymlink(path: string, target: VirtualFile): VirtualFileSymlink | undefined; + /** + * Adds a symbolic link to a target entry for a path relative to the current directory. + */ public addSymlink(path: string, target: VirtualDirectory): VirtualDirectorySymlink | undefined; - public addSymlink(path: string, target: string | VirtualFile | VirtualDirectory): VirtualSymlink | undefined; - public addSymlink(path: string, target: string | VirtualFile | VirtualDirectory) { + /** + * Adds a symbolic link to a target entry for a path relative to the current directory. + */ + public addSymlink(path: string, target: string | VirtualEntry): VirtualSymlink | undefined; + public addSymlink(path: string, target: string | VirtualEntry) { if (typeof target === "string") target = vpath.resolve(this.currentDirectory, target); return this.root.addSymlink(vpath.resolve(this.currentDirectory, path), target); } + /** + * Removes a directory (and all of its contents) at a path relative to the current directory. + */ public removeDirectory(path: string): boolean { return this.root.removeDirectory(vpath.resolve(this.currentDirectory, path)); } + /** + * Removes a file at a path relative to the current directory. + */ public removeFile(path: string): boolean { return this.root.removeFile(vpath.resolve(this.currentDirectory, path)); } + /** + * Reads the contents of a file at a path relative to the current directory. + */ public readFile(path: string): string | undefined { const file = this.getFile(vpath.resolve(this.currentDirectory, path)); - return file && file.getContent(); + return file && file.content; } + /** + * Writes the contents of a file at a path relative to the current directory. + */ public writeFile(path: string, content: string): void { path = vpath.resolve(this.currentDirectory, path); const file = this.getFile(path) || this.addFile(path); if (file) { - file.setContent(content); + file.content = content; } } + /** + * Gets a value indicating whether a path relative to the current directory exists and is a directory. + */ public directoryExists(path: string) { return this.getEntry(path) instanceof VirtualDirectory; } + /** + * Gets a value indicating whether a path relative to the current directory exists and is a file. + */ public fileExists(path: string) { return this.getEntry(path) instanceof VirtualFile; } - public sameName(a: string, b: string) { - return compareStrings(a, b, !this.useCaseSensitiveFileNames) === 0; - } - + /** + * If an entry is a symbolic link, gets the resolved target of the link. Otherwise, returns the entry. + */ public getRealEntry(entry: VirtualDirectory): VirtualDirectory | undefined; + /** + * If an entry is a symbolic link, gets the resolved target of the link. Otherwise, returns the entry. + */ public getRealEntry(entry: VirtualFile): VirtualFile | undefined; - public getRealEntry(entry: VirtualFile | VirtualDirectory): VirtualFile | VirtualDirectory | undefined; - public getRealEntry(entry: VirtualFile | VirtualDirectory): VirtualFile | VirtualDirectory | undefined { + /** + * If an entry is a symbolic link, gets the resolved target of the link. Otherwise, returns the entry. + */ + public getRealEntry(entry: VirtualEntry): VirtualEntry | undefined; + public getRealEntry(entry: VirtualEntry): VirtualEntry | undefined { if (entry instanceof VirtualFileSymlink || entry instanceof VirtualDirectorySymlink) { - return findTarget(this, entry.target); + return findTarget(this, entry.targetPath); } return entry; } + /** + * Gets an entry from a path relative to the current directory. + */ public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + /** + * Gets an entry from a path relative to the current directory. + */ public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; - public getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; + /** + * Gets an entry from a path relative to the current directory. + */ + public getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualEntry | undefined; public getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }) { return this.root.getEntry(vpath.resolve(this.currentDirectory, path), options); } + /** + * Gets a file from a path relative to the current directory. + */ public getFile(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp }): VirtualFile | undefined { return this.root.getFile(vpath.resolve(this.currentDirectory, path), options); } + /** + * Gets a directory from a path relative to the current directory. + */ public getDirectory(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp }): VirtualDirectory | undefined { return this.root.getDirectory(vpath.resolve(this.currentDirectory, path), options); } + /** + * Gets the accessible file system entries from a path relative to the current directory. + */ public getAccessibleFileSystemEntries(path: string) { const entry = this.getEntry(path); if (entry instanceof VirtualDirectory) { @@ -542,6 +399,76 @@ namespace Utils { return { files: [], directories: [] }; } + /** + * Watch a path for changes to a file. + */ + public watchFile(path: string, watcher: (path: string, change: FileSystemChange) => void): ts.FileWatcher { + if (!this._watchedFiles) { + const pathComparer = this.useCaseSensitiveFileNames ? vpath.compare.caseSensitive : vpath.compare.caseInsensitive; + this._watchedFiles = new KeyedCollection(pathComparer); + } + + path = vpath.resolve(this.currentDirectory, path); + let watchers = this._watchedFiles.get(path); + if (!watchers) this._watchedFiles.set(path, watchers = []); + + const entry: FileWatcherEntry = { watcher }; + watchers.push(entry); + + return { + close: () => { + const watchers = this._watchedFiles.get(path); + if (watchers) { + ts.orderedRemoveItem(watchers, entry); + if (watchers.length === 0) { + this._watchedFiles.delete(path); + } + } + } + }; + } + + /** + * Watch a directory for changes to the contents of the directory. + */ + public watchDirectory(path: string, watcher: (path: string) => void, recursive?: boolean) { + if (!this._watchedDirectories) { + const pathComparer = this.useCaseSensitiveFileNames ? vpath.compare.caseSensitive : vpath.compare.caseInsensitive; + this._watchedDirectories = new KeyedCollection(pathComparer); + } + + path = vpath.resolve(this.currentDirectory, path); + let watchers = this._watchedDirectories.get(path); + if (!watchers) { + watchers = []; + watchers.recursiveCount = 0; + this._watchedDirectories.set(path, watchers); + } + + const entry: DirectoryWatcherEntry = { watcher, recursive }; + watchers.push(entry); + if (recursive) watchers.recursiveCount++; + + return { + close: () => { + const watchers = this._watchedDirectories.get(path); + if (watchers) { + ts.orderedRemoveItem(watchers, entry); + if (watchers.length === 0) { + this._watchedDirectories.delete(path); + } + else if (entry.recursive) { + watchers.recursiveCount--; + } + } + } + }; + } + + /** + * Creates a shadow copy of this file system. Changes made to the shadow do not affect + * this file system. + */ public shadow(): VirtualFileSystem { const fs = new VirtualFileSystem(this.currentDirectory, this.useCaseSensitiveFileNames); fs._shadowRoot = this; @@ -550,17 +477,17 @@ namespace Utils { public debugPrint(): void { console.log(`cwd: ${this.currentDirectory}`); - for (const entry of this.getEntries({ recursive: true })) { + for (const entry of this.root.getEntries({ recursive: true })) { if (entry instanceof VirtualDirectory) { console.log(entry.path.endsWith("/") ? entry.path : entry.path + "/"); if (entry instanceof VirtualDirectorySymlink) { - console.log(`-> ${entry.target.endsWith("/") ? entry.target : entry.target + "/"}`); + console.log(`-> ${entry.targetPath.endsWith("/") ? entry.targetPath : entry.targetPath + "/"}`); } } else { console.log(entry.path); if (entry instanceof VirtualFileSymlink) { - console.log(`-> ${entry.target}`); + console.log(`-> ${entry.targetPath}`); } } } @@ -570,60 +497,363 @@ namespace Utils { this.root.makeReadOnly(); } - protected getOwnEntries() { - return this.root["getOwnEntries"](); + private onRootFileSystemChange(path: string, change: FileSystemChange) { + const fileWatchers = this._watchedFiles && this._watchedFiles.get(path); + if (fileWatchers) { + for (const { watcher } of fileWatchers) { + watcher(path, change); + } + } + + if (this._watchedDirectories && (change === "added" || change === "removed")) { + const ignoreCase = !this.useCaseSensitiveFileNames; + const dirname = vpath.dirname(path); + this._watchedDirectories.forEach((watchers, path) => { + const exactMatch = vpath.equals(dirname, path, ignoreCase); + if (exactMatch || (watchers.recursiveCount > 0 && vpath.beneath(dirname, path, ignoreCase))) { + for (const { recursive, watcher } of watchers) { + if (exactMatch || !recursive) { + watcher(path); + } + } + } + }); + } } } - export class VirtualDirectory extends VirtualFileSystemContainer { + export interface VirtualFileSystemEntry { + on(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + emit(event: "fileSystemChange", path: string, change: FileSystemChange): boolean; + } + + export abstract class VirtualFileSystemEntry extends VirtualFileSystemObject { + private _path: string; + private _metadata: Metadata; + + /** + * Gets the name of this entry. + */ + public readonly name: string; + + constructor(name: string) { + super(); + this.name = name; + } + + /** + * Gets the file system to which this entry belongs. + */ + public get fileSystem(): VirtualFileSystem { + if (!this.parent) throw new TypeError(); + return this.parent.fileSystem; + } + + /** + * Gets the parent directory for this entry. + */ + public abstract get parent(): VirtualDirectory | undefined; + + /** + * Gets the entry that this entry shadows. + */ + public abstract get shadowRoot(): VirtualEntry | undefined; + + /** + * Gets metadata about this entry. + */ + public get metadata(): Metadata { + return this._metadata || (this._metadata = new Metadata(this.shadowRoot ? this.shadowRoot.metadata : undefined)); + } + + /** + * Gets the full path to this entry. + */ + public get path(): string { + return this._path || (this._path = vpath.combine(this.parent.path, this.name)); + } + + /** + * Gets the path to this entry relative to the current directory. + */ + public get relative(): string { + return this.relativeTo(this.fileSystem.currentDirectory); + } + + /** + * Gets a value indicating whether this entry exists. + */ + public get exists(): boolean { + return this.parent.exists + && this.parent.getEntry(this.name) === this as VirtualFileSystemEntry; + } + + /** + * Gets a relative path from this entry to another entry. + */ + public relativeTo(other: string | VirtualEntry) { + if (other) { + const otherPath = typeof other === "string" ? other : other.path; + const ignoreCase = !this.fileSystem.useCaseSensitiveFileNames; + return vpath.relative(otherPath, this.path, ignoreCase); + } + return this.path; + } + + /** + * Creates a file system entry that shadows this file system entry. + * @param parent The container for the shadowed entry. + */ + public abstract shadow(parent: VirtualDirectory): VirtualEntry; + + protected shadowPreamble(parent: VirtualDirectory): void { + this.checkShadowParent(parent); + this.checkShadowFileSystem(parent.fileSystem); + } + + protected checkShadowParent(shadowParent: VirtualDirectory) { + if (this.parent !== shadowParent.shadowRoot) throw new Error("Incorrect shadow parent"); + } + + protected checkShadowFileSystem(shadowFileSystem: VirtualFileSystem) { + let fileSystem: VirtualFileSystem | undefined = this.fileSystem; + while (fileSystem) { + if (shadowFileSystem === fileSystem) throw new Error("Cannot create shadow for parent in the same file system."); + fileSystem = fileSystem.shadowRoot; + } + } + } + + export interface VirtualDirectory { + on(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + on(event: "childAdded", listener: (child: VirtualEntry) => void): this; + on(event: "childRemoved", listener: (child: VirtualEntry) => void): this; + emit(event: "fileSystemChange", path: string, change: FileSystemChange): boolean; + emit(event: "childAdded", child: VirtualEntry): boolean; + emit(event: "childRemoved", child: VirtualEntry): boolean; + } + + export class VirtualDirectory extends VirtualFileSystemEntry { protected _shadowRoot: VirtualDirectory | undefined; - private _parent: VirtualFileSystemContainer; - private _entries: KeyedCollection | undefined; - // private _resolver: FileSystemResolver | undefined; + private _parent: VirtualDirectory; + private _entries: KeyedCollection | undefined; + private _resolver: FileSystemResolver | undefined; + private _onChildFileSystemChange: (path: string, change: FileSystemChange) => void; - constructor(parent: VirtualFileSystemContainer, name: string /*, resolver?: FileSystemResolver */) { + constructor(parent: VirtualDirectory | undefined, name: string, resolver?: FileSystemResolver) { super(name); + if (parent === undefined && !(this instanceof VirtualRoot)) throw new TypeError(); this._parent = parent; this._entries = undefined; - // this._resolver = resolver; + this._resolver = resolver; this._shadowRoot = undefined; + this._onChildFileSystemChange = (path, change) => this.onChildFileSystemChange(path, change); } - public get parent(): VirtualFileSystemContainer { + /** + * Gets the container for this entry. + */ + public get parent(): VirtualDirectory | undefined { return this._parent; } - public get shadowRoot(): VirtualDirectory | undefined { - return this._shadowRoot; + /** + * Gets the entry that this entry shadows. + */ + public get shadowRoot(): VirtualDirectory | undefined { + return this._shadowRoot; + } + + /** + * Gets the child entries in this directory for the provided options. + */ + public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile[]; + /** + * Gets the child entries in this directory for the provided options. + */ + public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory[]; + /** + * Gets the child entries in this directory for the provided options. + */ + public getEntries(options?: { recursive?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualEntry[]; + public getEntries(options: { recursive?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualEntry[] { + const results: VirtualEntry[] = []; + if (options.recursive) { + this.getOwnEntries().forEach(entry => { + if (entry instanceof VirtualFile) { + if (isMatch(entry, options)) { + results.push(entry); + } + } + else if (entry instanceof VirtualDirectory) { + if (isMatch(entry, options)) { + results.push(entry); + } + for (const child of entry.getEntries(options)) { + results.push(child); + } + } + }); + } + else { + this.getOwnEntries().forEach(entry => { + if (isMatch(entry, options)) { + results.push(entry); + } + }); + } + return results; + } + + /** + * Gets the child directories in this directory for the provided options. + */ + public getDirectories(options: { recursive?: boolean, pattern?: RegExp } = {}): VirtualDirectory[] { + return this.getEntries({ ...options, kind: "directory" }); + } + + /** + * Gets the child files in this directory for the provided options. + */ + public getFiles(options: { recursive?: boolean, pattern?: RegExp } = {}): VirtualFile[] { + return this.getEntries({ ...options, kind: "file" }); + } + + /** + * Gets the names of the child entries in this directory for the provided options. + */ + public getEntryNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): string[] { + return this.getEntries(options).map(entry => + options && options.qualified ? entry.path : + options && options.recursive ? entry.relativeTo(this) : + entry.name); + } + + /** + * Gets the names of the child directories in this directory for the provided options. + */ + public getDirectoryNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp } = {}): string[] { + return this.getEntryNames({ ...options, kind: "directory" }); + } + + /** + * Gets the names of the child files in this directory for the provided options. + */ + public getFileNames(options: { recursive?: boolean, qualified?: boolean, pattern?: RegExp } = {}): string[] { + return this.getEntryNames({ ...options, kind: "file" }); + } + + /** + * Gets an entry from a path relative to this directory. + */ + public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + /** + * Gets an entry from a path relative to this directory. + */ + public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; + /** + * Gets an entry from a path relative to this directory. + */ + public getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualEntry | undefined; + public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualEntry | undefined { + const components = this.parsePath(path); + const directory = this.walkContainers(components, /*create*/ false); + return directory && directory.getOwnEntry(components[components.length - 1], options); + } + + /** + * Gets a directory from a path relative to this directory. + */ + public getDirectory(path: string, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualDirectory | undefined { + return this.getEntry(path, { ...options, kind: "directory" }); + } + + /** + * Gets a file from a path relative to this directory. + */ + public getFile(path: string, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualFile | undefined { + return this.getEntry(path, { ...options, kind: "file" }); + } + + /** + * Finds an entry for a relative path along the provided axis. + */ + public findEntry(path: string, axis: Axis, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + /** + * Finds an entry for a relative path along the provided axis. + */ + public findEntry(path: string, axis: Axis, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; + /** + * Finds an entry for a relative path along the provided axis. + */ + public findEntry(path: string, axis: Axis, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualEntry | undefined; + public findEntry(path: string, axis: Axis, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualEntry | undefined { + const walkAncestors = axis === "ancestors-or-self" || axis === "ancestors"; + const walkDescendents = axis === "descendents-or-self" || axis === "descendents"; + const walkSelf = axis === "ancestors-or-self" || axis === "self" || axis === "descendents-or-self"; + if (walkSelf) { + const entry = this.getEntry(path, options); + if (entry) return entry; + } + if (walkAncestors) { + const entry = this.parent && this.parent.findEntry(path, "ancestors-or-self", options); + if (entry) return entry; + } + if (walkDescendents) { + for (const child of this.getDirectories()) { + const entry = child.findEntry(path, "descendents-or-self", options); + if (entry) return entry; + } + } + } + + /** + * Finds a directory for a relative path along the provided axis. + */ + public findDirectory(path: string, axis: Axis, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualDirectory | undefined { + return this.findEntry(path, axis, { ...options, kind: "directory" }); } - public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; - public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; - public getEntry(path: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; - public getEntry(path: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualFile | VirtualDirectory | undefined { - const components = this.parsePath(path); - const directory = this.walkContainers(components, /*create*/ false); - return directory && directory.getOwnEntry(components[components.length - 1], options); + /** + * Finds a file for a relative path along the provided axis. + */ + public findFile(path: string, axis: Axis, options: { followSymlinks?: boolean, pattern?: RegExp } = {}): VirtualFile | undefined { + return this.findEntry(path, axis, { ...options, kind: "file" }); } - public addDirectory(path: string /*, resolver?: FileSystemResolver*/): VirtualDirectory | undefined { + /** + * Adds a directory (and all intermediate directories) for a path relative to this directory. + */ + public addDirectory(path: string, resolver?: FileSystemResolver): VirtualDirectory | undefined { this.writePreamble(); const components = this.parsePath(path); const directory = this.walkContainers(components, /*create*/ true); - return directory && directory.addOwnDirectory(components[components.length - 1] /*, resolver*/); + return directory && directory.addOwnDirectory(components[components.length - 1], resolver); } - public addFile(path: string, content?: /*FileSystemResolver["getContent"] |*/ string | undefined, options?: { overwrite?: boolean }): VirtualFile | undefined { + /** + * Adds a file (and all intermediate directories) for a path relative to this directory. + */ + public addFile(path: string, content?: FileSystemResolver | ContentResolver | string, options?: { overwrite?: boolean }): VirtualFile | undefined { this.writePreamble(); const components = this.parsePath(path); const directory = this.walkContainers(components, /*create*/ true); return directory && directory.addOwnFile(components[components.length - 1], content, options); } + /** + * Adds a symbolic link to a target entry for a path relative to this directory. + */ public addSymlink(path: string, target: VirtualFile): VirtualFileSymlink | undefined; + /** + * Adds a symbolic link to a target entry for a path relative to this directory. + */ public addSymlink(path: string, target: VirtualDirectory): VirtualDirectorySymlink | undefined; - public addSymlink(path: string, target: string | VirtualFile | VirtualDirectory): VirtualSymlink | undefined; - public addSymlink(path: string, target: string | VirtualFile | VirtualDirectory): VirtualSymlink | undefined { + /** + * Adds a symbolic link to a target entry for a path relative to this directory. + */ + public addSymlink(path: string, target: string | VirtualEntry): VirtualSymlink | undefined; + public addSymlink(path: string, target: string | VirtualEntry): VirtualSymlink | undefined { this.writePreamble(); const targetEntry = typeof target === "string" ? this.fileSystem.getEntry(vpath.resolve(this.path, target)) : target; if (targetEntry === undefined) return undefined; @@ -632,6 +862,9 @@ namespace Utils { return directory && directory.addOwnSymlink(components[components.length - 1], targetEntry); } + /** + * Removes a directory (and all of its contents) at a path relative to this directory. + */ public removeDirectory(path: string): boolean { this.writePreamble(); const components = this.parsePath(path); @@ -639,6 +872,9 @@ namespace Utils { return directory ? directory.removeOwnDirectory(components[components.length - 1]) : false; } + /** + * Removes a file at a path relative to this directory. + */ public removeFile(path: string): boolean { this.writePreamble(); this.writePreamble(); @@ -647,9 +883,13 @@ namespace Utils { return directory ? directory.removeOwnFile(components[components.length - 1]) : false; } - public shadow(parent: VirtualFileSystemContainer): VirtualDirectory { - this.shadowPreamble(parent); - const shadow = new VirtualDirectory(parent, this.name); + /** + * Creates a shadow copy of this directory. Changes made to the shadow do not affect + * this directory. + */ + public shadow(shadowParent: VirtualDirectory): VirtualDirectory { + this.shadowPreamble(shadowParent); + const shadow = new VirtualDirectory(shadowParent, this.name); shadow._shadowRoot = this; return shadow; } @@ -662,10 +902,11 @@ namespace Utils { protected getOwnEntries() { if (!this._entries) { - // const resolver = this._resolver; - const entries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); - // this._resolver = undefined; - /*if (resolver) { + const entries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); + const resolver = this._resolver; + const shadowRoot = this._shadowRoot; + if (resolver) { + this._resolver = undefined; const { files, directories } = resolver.getEntries(this); for (const dir of directories) { const vdir = new VirtualDirectory(this, dir, resolver); @@ -673,14 +914,14 @@ namespace Utils { entries.set(vdir.name, vdir); } for (const file of files) { - const vfile = new VirtualFile(this, file, file => resolver.getContent(file)); + const vfile = new VirtualFile(this, file, resolver); if (this.isReadOnly) vfile.makeReadOnly(); entries.set(vfile.name, vfile); } } - else*/ if (this._shadowRoot) { - this._shadowRoot.getOwnEntries().forEach(entry => { - const clone = (entry).shadow(this); + else if (shadowRoot) { + shadowRoot.getOwnEntries().forEach(entry => { + const clone = entry.shadow(this); if (this.isReadOnly) clone.makeReadOnly(); entries.set(clone.name, clone); }); @@ -690,59 +931,24 @@ namespace Utils { return this._entries; } - private parsePath(path: string) { - return vpath.parse(vpath.normalize(path)); - } - - private walkContainers(components: string[], create: boolean) { - // no absolute paths (unless this is the root) - if (!!components[0] === !(this.parent instanceof VirtualFileSystem)) return undefined; - - // no relative paths - if (components[1] === "..") return undefined; - - // walk the components - let directory: VirtualDirectory | undefined = this; - for (let i = this.parent instanceof VirtualFileSystem ? 0 : 1; i < components.length - 1; i++) { - directory = create ? directory.getOrAddOwnDirectory(components[i]) : directory.getOwnDirectory(components[i]); - if (directory === undefined) return undefined; - } - - return directory; - } - - private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; - private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; - private getOwnEntry(name: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualFile | VirtualDirectory | undefined; - private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualFile | VirtualDirectory | undefined { - const entry = this.getOwnEntries().get(name); - return entry && isMatch(entry, options) ? options.followSymlinks ? this.fileSystem.getRealEntry(entry) : entry : undefined; - } - - private getOwnDirectory(name: string) { - return this.getOwnEntry(name, { kind: "directory" }); - } - - private getOrAddOwnDirectory(name: string) { - return this.getOwnDirectory(name) || this.addOwnDirectory(name); - } - - private addOwnDirectory(name: string /*, resolver?: FileSystemResolver */): VirtualDirectory | undefined { + protected addOwnDirectory(name: string, resolver?: FileSystemResolver): VirtualDirectory | undefined { const existing = this.getOwnEntry(name); if (existing) { - if (/*!resolver &&*/ existing instanceof VirtualDirectory) { + if (!resolver && existing instanceof VirtualDirectory) { return existing; } return undefined; } - const entry = new VirtualDirectory(this, name /*, resolver */); + const entry = new VirtualDirectory(this, name, resolver); this.getOwnEntries().set(entry.name, entry); - this.raiseOnChildAdded(entry); + this.emit("childAdded", entry); + entry.emit("fileSystemChange", entry.path, "added"); + entry.addListener("fileSystemChange", this._onChildFileSystemChange); return entry; } - private addOwnFile(name: string, content?: /*FileSystemResolver["getContent"]*/ | string | undefined, options: { overwrite?: boolean } = {}): VirtualFile | undefined { + protected addOwnFile(name: string, content?: FileSystemResolver | ContentResolver | string, options: { overwrite?: boolean } = {}): VirtualFile | undefined { const existing = this.getOwnEntry(name); if (existing) { if (!options.overwrite || !(existing instanceof VirtualFile)) { @@ -755,229 +961,395 @@ namespace Utils { const entry = new VirtualFile(this, name, content); this.getOwnEntries().set(entry.name, entry); - this.raiseOnChildAdded(entry); + this.emit("childAdded", entry); + entry.emit("fileSystemChange", entry.path, "added"); + entry.addListener("fileSystemChange", this._onChildFileSystemChange); return entry; } - private addOwnSymlink(name: string, target: VirtualFile | VirtualDirectory): VirtualSymlink | undefined { + protected addOwnSymlink(name: string, target: VirtualEntry): VirtualSymlink | undefined { if (this.getOwnEntry(name)) return undefined; const entry = target instanceof VirtualFile ? new VirtualFileSymlink(this, name, target.path) : new VirtualDirectorySymlink(this, name, target.path); this.getOwnEntries().set(entry.name, entry); - this.raiseOnChildAdded(entry); + this.emit("childAdded", entry); + entry.emit("fileSystemChange", entry.path, "added"); + entry.addListener("fileSystemChange", this._onChildFileSystemChange); return entry; } - private removeOwnDirectory(name: string) { + protected removeOwnDirectory(name: string) { const entries = this.getOwnEntries(); const entry = entries.get(name); if (entry instanceof VirtualDirectory) { entries.delete(name); - this.raiseOnChildRemoved(entry); + this.emit("childRemoved", entry); + this.emit("fileSystemChange", entry.path, "removed"); + entry.removeListener("fileSystemChange", this._onChildFileSystemChange); return true; } return false; } - private removeOwnFile(name: string) { + protected removeOwnFile(name: string) { const entries = this.getOwnEntries(); const entry = entries.get(name); if (entry instanceof VirtualFile) { entries.delete(name); - this.raiseOnChildRemoved(entry); + this.emit("childRemoved", entry); + this.emit("fileSystemChange", entry.path, "removed"); + entry.removeListener("fileSystemChange", this._onChildFileSystemChange); return true; } return false; } + + private parsePath(path: string) { + return vpath.parse(vpath.normalize(path)); + } + + private walkContainers(components: string[], create: boolean) { + // no absolute paths (unless this is the root) + if (!!components[0] === !!this.parent) return undefined; + + // no relative paths + if (components[1] === "..") return undefined; + + // walk the components + let directory: VirtualDirectory | undefined = this; + for (let i = this.parent ? 1 : 0; i < components.length - 1; i++) { + directory = create ? directory.getOrAddOwnDirectory(components[i]) : directory.getOwnDirectory(components[i]); + if (directory === undefined) return undefined; + } + + return directory; + } + + private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile | undefined; + private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory | undefined; + private getOwnEntry(name: string, options?: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualEntry | undefined; + private getOwnEntry(name: string, options: { followSymlinks?: boolean, pattern?: RegExp, kind?: "file" | "directory" } = {}): VirtualEntry | undefined { + const entry = this.getOwnEntries().get(name); + return entry && isMatch(entry, options) ? options.followSymlinks ? this.fileSystem.getRealEntry(entry) : entry : undefined; + } + + private getOwnDirectory(name: string) { + return this.getOwnEntry(name, { kind: "directory" }); + } + + private getOrAddOwnDirectory(name: string) { + return this.getOwnDirectory(name) || this.addOwnDirectory(name); + } + + private onChildFileSystemChange(path: string, change: FileSystemChange) { + this.emit("fileSystemChange", path, change); + } } export class VirtualDirectorySymlink extends VirtualDirectory { private _targetPath: string; private _target: VirtualDirectory | undefined; - private _symLinks = new Map(); - private _symEntries: KeyedCollection | undefined; - private _onTargetParentChildRemoved: (entry: VirtualFile | VirtualDirectory) => void; - private _onTargetChildRemoved: (entry: VirtualFile | VirtualDirectory) => void; - private _onTargetChildAdded: (entry: VirtualFile | VirtualDirectory) => void; + private _pullEntries: KeyedCollection | undefined; + private _allEntries: KeyedCollection | undefined; + private _onTargetParentChildRemoved: (entry: VirtualEntry) => void; + private _onTargetChildRemoved: (entry: VirtualEntry) => void; + private _onTargetChildAdded: (entry: VirtualEntry) => void; + private _onTargetFileSystemChange: (path: string, change: FileSystemChange) => void; - constructor(parent: VirtualFileSystemContainer, name: string, target: string) { + constructor(parent: VirtualDirectory, name: string, target: string) { super(parent, name); + this._pullEntries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); this._targetPath = target; this._onTargetParentChildRemoved = entry => this.onTargetParentChildRemoved(entry); this._onTargetChildAdded = entry => this.onTargetChildAdded(entry); this._onTargetChildRemoved = entry => this.onTargetChildRemoved(entry); + this._onTargetFileSystemChange = (path, change) => this.onTargetFileSystemChange(path, change); } - public get target() { + /** + * Gets the path to the target of the symbolic link. + */ + public get targetPath() { return this._targetPath; } - public set target(value: string) { - this.writePreamble(); + /** + * Sets the path to the target of the symbolic link. + */ + public set targetPath(value: string) { if (this._targetPath !== value) { - this._targetPath = value; + this.writePreamble(); + this._targetPath = vpath.resolve(this.path, value); this.invalidateTarget(); } } - public get isBroken(): boolean { - return this.getRealDirectory() === undefined; - } - - public getRealDirectory(): VirtualDirectory | undefined { + /** + * Gets the resolved target directory for this symbolic link. + */ + public get target(): VirtualDirectory | undefined { this.resolveTarget(); return this._target; } - public addDirectory(path: string /*, resolver?: FileSystemResolver*/): VirtualDirectory | undefined { - const target = this.getRealDirectory(); - return target && target.addDirectory(path /*, resolver*/); + /** + * Gets a value indicating whether the symbolic link is broken. + */ + public get isBroken(): boolean { + return this.target === undefined; + } + + /** + * Creates a shadow copy of this directory. Changes made to the shadow do not affect + * this directory. + */ + public shadow(shadowParent: VirtualDirectory): VirtualDirectorySymlink { + this.shadowPreamble(shadowParent); + const shadow = new VirtualDirectorySymlink(shadowParent, this.name, this.targetPath); + shadow._shadowRoot = this; + return shadow; } - public addFile(path: string, content?: /*FileSystemResolver["getContent"]*/ | string | undefined): VirtualFile | undefined { - const target = this.getRealDirectory(); - return target && target.addFile(path, content); + protected addOwnDirectory(name: string, resolver?: FileSystemResolver): VirtualDirectory | undefined { + const realTarget = this.target; + const child = realTarget && realTarget.addDirectory(name, resolver); + return child && this.getView(child); } - public removeDirectory(path: string): boolean { - const target = this.getRealDirectory(); - return target && target.removeDirectory(path) || false; + protected addOwnFile(name: string, content?: FileSystemResolver | ContentResolver | string): VirtualFile | undefined { + const realTarget = this.target; + const child = realTarget && realTarget.addFile(name, content); + return child && this.getView(child); } - public removeFile(path: string): boolean { - const target = this.getRealDirectory(); - return target && target.removeFile(path) || false; + protected addOwnSymlink(name: string, target: VirtualEntry): VirtualSymlink | undefined { + const realTarget = this.target; + const child = realTarget && realTarget.addSymlink(name, target); + return child && this.getView(child); } - public shadow(parent: VirtualFileSystemContainer): VirtualDirectorySymlink { - this.shadowPreamble(parent); - const shadow = new VirtualDirectorySymlink(parent, this.name, this.target); - shadow._shadowRoot = this; - return shadow; + protected removeOwnDirectory(name: string): boolean { + const realTarget = this.target; + return realTarget && realTarget.removeDirectory(name) || false; } - public resolveTarget(): void { - if (!this._target) { - const entry = findTarget(this.fileSystem, this.target); - if (entry instanceof VirtualDirectory) { - this._target = entry; - this._target.parent.addOnChildRemoved(this._onTargetParentChildRemoved); - this._target.addOnChildAdded(this._onTargetChildAdded); - this._target.addOnChildRemoved(this._onTargetChildRemoved); - } - } + protected removeOwnFile(name: string): boolean { + const realTarget = this.target; + return realTarget && realTarget.removeFile(name) || false; } - protected getOwnEntries(): KeyedCollection { - if (!this._symEntries) { - const target = this.getRealDirectory(); - this._symEntries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); - if (target) { - for (const entry of target.getEntries()) { - this._symEntries.set(entry.name, this.getWrappedEntry(entry)); + protected getOwnEntries(): KeyedCollection { + if (!this._allEntries) { + const realTarget = this.target; + this._allEntries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); + if (realTarget) { + for (const entry of realTarget.getEntries()) { + this._allEntries.set(entry.name, this.getView(entry)); } } } - return this._symEntries; + return this._allEntries; } - private getWrappedEntry(entry: VirtualFile | VirtualDirectory) { - let symlink = this._symLinks.get(entry); + private getView(entry: VirtualFile): VirtualFileView; + private getView(entry: VirtualDirectory): VirtualDirectoryView; + private getView(entry: VirtualEntry): VirtualEntryView; + private getView(entry: VirtualEntry) { + let symlink = this._pullEntries.get(entry.name); if (entry instanceof VirtualFile) { - if (symlink instanceof VirtualFileSymlink) { + if (symlink instanceof VirtualFileView) { return symlink; } - symlink = new VirtualFileSymlink(this, entry.name, entry.path); - this._symLinks.set(entry, symlink); + symlink = new VirtualFileView(this, entry.name, entry.path); + this._pullEntries.set(entry.name, symlink); } else { - if (symlink instanceof VirtualDirectorySymlink) { + if (symlink instanceof VirtualDirectoryView) { return symlink; } - symlink = new VirtualDirectorySymlink(this, entry.name, entry.path); - this._symLinks.set(entry, symlink); + symlink = new VirtualDirectoryView(this, entry.name, entry.path); + this._pullEntries.set(entry.name, symlink); } return symlink; } - private onTargetParentChildRemoved(entry: VirtualFileSystemEntry) { - if (entry !== this._target) return; - this.invalidateTarget(); + private resolveTarget(): void { + if (!this._target) { + const entry = findTarget(this.fileSystem, this.targetPath); + if (entry instanceof VirtualDirectory) { + this._target = entry; + if (this._target.parent) this._target.parent.addListener("childRemoved", this._onTargetParentChildRemoved); + this._target.addListener("childAdded", this._onTargetChildAdded); + this._target.addListener("childRemoved", this._onTargetChildRemoved); + this._target.addListener("fileSystemChange", this._onTargetFileSystemChange); + } + } + } + + private invalidateTarget() { + if (!this._target) return; + if (this._target.parent) this._target.parent.removeListener("childRemoved", this._onTargetParentChildRemoved); + this._target.removeListener("childAdded", this._onTargetChildAdded); + this._target.removeListener("childRemoved", this._onTargetChildRemoved); + this._target.removeListener("fileSystemChange", this._onTargetFileSystemChange); + this._target = undefined; + this._pullEntries.clear(); + this._allEntries = undefined; + } + + private onTargetParentChildRemoved(entry: VirtualEntry) { + if (entry === this._target) { + this.invalidateTarget(); + } } - private onTargetChildAdded(entry: VirtualFile | VirtualDirectory) { - const wrapped = this.getWrappedEntry(entry); + private onTargetChildAdded(entry: VirtualEntry) { + const wrapped = this.getView(entry); this.getOwnEntries().set(entry.name, wrapped); - this.raiseOnChildAdded(wrapped); + this.emit("childAdded", wrapped); } - private onTargetChildRemoved(entry: VirtualFile | VirtualDirectory) { - const wrapped = this.getWrappedEntry(entry); + private onTargetChildRemoved(entry: VirtualEntry) { + const symlink = this.getView(entry); this.getOwnEntries().delete(entry.name); - this._symLinks.delete(entry); - this.raiseOnChildRemoved(wrapped); + this._pullEntries.delete(entry.name); + this.emit("childRemoved", symlink); } - private invalidateTarget() { - if (!this._target) return; - this._target.parent.removeOnChildRemoved(this._onTargetParentChildRemoved); - this._target.removeOnChildAdded(this._onTargetChildAdded); - this._target.removeOnChildRemoved(this._onTargetChildRemoved); - this._target = undefined; - this._symLinks.clear(); - this._symEntries = undefined; + protected onTargetFileSystemChange(path: string, change: FileSystemChange) { + const ignoreCase = !this.fileSystem.useCaseSensitiveFileNames; + if (vpath.beneath(this.targetPath, path, ignoreCase)) { + const relative = vpath.relative(this.targetPath, path, ignoreCase); + const symbolicPath = vpath.combine(this.path, relative); + this.emit("fileSystemChange", symbolicPath, change); + } + } + } + + class VirtualDirectoryView extends VirtualDirectorySymlink { + /** + * Creates a shadow copy of this directory. Changes made to the shadow do not affect + * this directory. + */ + public shadow(shadowParent: VirtualDirectory): VirtualDirectoryView { + this.shadowPreamble(shadowParent); + const shadow = new VirtualDirectoryView(shadowParent, this.name, this.targetPath); + shadow._shadowRoot = this; + return shadow; + } + + protected onTargetFileSystemChange() { /* views do not propagate file system events */ } + } + + class VirtualRoot extends VirtualDirectory { + private _fileSystem: VirtualFileSystem; + + constructor(fileSystem: VirtualFileSystem) { + super(/*parent*/ undefined, ""); + this._fileSystem = fileSystem; + } + + public get fileSystem(): VirtualFileSystem { + return this._fileSystem; + } + + public get path(): string { + return ""; + } + + public get exists(): boolean { + return true; + } + + public _shadow(shadowFileSystem: VirtualFileSystem) { + super.checkShadowFileSystem(shadowFileSystem); + const shadow = new VirtualRoot(shadowFileSystem); + shadow._shadowRoot = this; + return shadow; + } + + public shadow(): never { + throw new TypeError(); } } + export interface VirtualFile { + on(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + on(event: "contentChanged", listener: (entry: VirtualFile) => void): this; + emit(event: "fileSystemChange", path: string, change: FileSystemChange): boolean; + emit(event: "contentChanged", entry: VirtualFile): boolean; + } + export class VirtualFile extends VirtualFileSystemEntry { protected _shadowRoot: VirtualFile | undefined; private _parent: VirtualDirectory; private _content: string | undefined; private _contentWasSet: boolean; - // private _resolver: FileSystemResolver["getContent"] | undefined; + private _resolver: FileSystemResolver | ContentResolver | undefined; - constructor(parent: VirtualDirectory, name: string, content?: /*FileSystemResolver["getContent"]*/ | string | undefined) { + constructor(parent: VirtualDirectory, name: string, content?: FileSystemResolver | ContentResolver | string) { super(name); this._parent = parent; this._content = typeof content === "string" ? content : undefined; - // this._resolver = typeof content === "function" ? content : undefined; + this._resolver = typeof content !== "string" ? content : undefined; this._shadowRoot = undefined; this._contentWasSet = this._content !== undefined; } + /** + * Gets the parent directory for this entry. + */ public get parent(): VirtualDirectory { return this._parent; } + /** + * Gets the entry that this entry shadows. + */ public get shadowRoot(): VirtualFile | undefined { return this._shadowRoot; } - public getContent(): string | undefined { + /** + * Gets the text content of this file. + */ + public get content(): string | undefined { if (!this._contentWasSet) { - // const resolver = this._resolver; + const resolver = this._resolver; const shadowRoot = this._shadowRoot; - /* if (resolver) { - this._content = resolver(this); + if (resolver) { + this._resolver = undefined; + this._content = typeof resolver === "function" ? resolver(this) : resolver.getContent(this); this._contentWasSet = true; } - else */ if (shadowRoot) { - this._content = shadowRoot.getContent(); + else if (shadowRoot) { + this._content = shadowRoot.content; this._contentWasSet = true; } } return this._content; } - public setContent(value: string | undefined) { - this.writePreamble(); - // this._resolver = undefined; - this._content = value; - this._contentWasSet = true; + /** + * Sets the text content of this file. + */ + public set content(value: string | undefined) { + if (this.content !== value) { + this.writePreamble(); + this._resolver = undefined; + this._content = value; + this._contentWasSet = true; + this.emit("contentChanged", this); + this.emit("fileSystemChange", this.path, "modified"); + } } - public shadow(parent: VirtualDirectory): VirtualFile { - this.shadowPreamble(parent); - const shadow = new VirtualFile(parent, this.name); + /** + * Creates a shadow copy of this file. Changes made to the shadow do not affect + * this file. + */ + public shadow(shadowParent: VirtualDirectory): VirtualFile { + this.shadowPreamble(shadowParent); + const shadow = new VirtualFile(shadowParent, this.name); shadow._shadowRoot = this; shadow._contentWasSet = false; return shadow; @@ -988,69 +1360,150 @@ namespace Utils { } export class VirtualFileSymlink extends VirtualFile { - private _target: string; + private _targetPath: string; + private _target: VirtualFile | undefined; + private _onTargetParentChildRemoved: (entry: VirtualEntry) => void; + private _onTargetContentChanged: () => void; + private _onTargetFileSystemChange: (path: string, change: FileSystemChange) => void; constructor(parent: VirtualDirectory, name: string, target: string) { super(parent, name); - this._target = target; + this._targetPath = target; + this._onTargetParentChildRemoved = entry => this.onTargetParentChildRemoved(entry); + this._onTargetContentChanged = () => this.onTargetContentChanged(); + this._onTargetFileSystemChange = (path, change) => this.onTargetFileSystemChange(path, change); } - public get target(): string { - return this._target; + /** + * Gets the path to the target of the symbolic link. + */ + public get targetPath(): string { + return this._targetPath; } - public set target(value: string) { - this.writePreamble(); - this._target = value; + /** + * Sets the path to the target of the symbolic link. + */ + public set targetPath(value: string) { + if (this._targetPath !== value) { + this.writePreamble(); + this._targetPath = vpath.resolve(this.path, value); + this.invalidateTarget(); + } } - public get isBroken(): boolean { - return this.getRealFile() === undefined; + /** + * Gets the resolved target file for this symbolic link. + */ + public get target(): VirtualFile | undefined { + this.resolveTarget(); + return this._target; } - public getRealFile(): VirtualFile | undefined { - const entry = findTarget(this.fileSystem, this.target); - return entry instanceof VirtualFile ? entry : undefined; + /** + * Gets a value indicating whether the symbolic link is broken. + */ + public get isBroken(): boolean { + return this.target === undefined; } - public getContent(): string | undefined { - const target = this.getRealFile(); - return target && target.getContent(); + /** + * Gets the text content of this file. + */ + public get content(): string | undefined { + const realTarget = this.target; + return realTarget && realTarget.content; } - public setContent(value: string | undefined) { - const target = this.getRealFile(); - if (target) target.setContent(value); + /** + * Sets the text content of this file. + */ + public set content(value: string | undefined) { + const realTarget = this.target; + if (realTarget) realTarget.content = value; } - public shadow(parent: VirtualDirectory) { - this.shadowPreamble(parent); - const shadow = new VirtualFileSymlink(parent, this.name, this.target); + /** + * Creates a shadow copy of this file. Changes made to the shadow do not affect + * this file. + */ + public shadow(shadowParent: VirtualDirectory) { + this.shadowPreamble(shadowParent); + const shadow = new VirtualFileSymlink(shadowParent, this.name, this.targetPath); shadow._shadowRoot = this; return shadow; } + + private resolveTarget() { + if (!this._target) { + const entry = findTarget(this.fileSystem, this.targetPath); + if (entry instanceof VirtualFile) { + this._target = entry; + if (this._target.parent) this._target.parent.addListener("childRemoved", this._onTargetParentChildRemoved); + this._target.addListener("contentChanged", this._onTargetContentChanged); + this._target.addListener("fileSystemChange", this._onTargetFileSystemChange); + } + } + } + + private invalidateTarget() { + if (!this._target) return; + if (this._target.parent) this._target.parent.removeListener("childRemoved", this._onTargetParentChildRemoved); + this._target.removeListener("contentChanged", this._onTargetContentChanged); + this._target.removeListener("fileSystemChange", this._onTargetFileSystemChange); + this._target = undefined; + } + + private onTargetParentChildRemoved(entry: VirtualEntry) { + if (entry === this._target) { + this.invalidateTarget(); + } + } + + private onTargetContentChanged() { + this.emit("contentChanged", this); + } + + protected onTargetFileSystemChange(_path: string, change: FileSystemChange) { + this.emit("fileSystemChange", this.path, change); + } } - export type VirtualSymlink = VirtualDirectorySymlink | VirtualFileSymlink; + class VirtualFileView extends VirtualFileSymlink { + /** + * Creates a shadow copy of this file. Changes made to the shadow do not affect + * this file. + */ + public shadow(shadowParent: VirtualDirectory) { + this.shadowPreamble(shadowParent); + const shadow = new VirtualFileView(shadowParent, this.name, this.targetPath); + shadow._shadowRoot = this; + return shadow; + } + + protected onTargetFileSystemChange() { /* views do not propagate file system events */ } + } - function findTarget(vfs: VirtualFileSystem, target: string, set?: Set): VirtualFile | VirtualDirectory | undefined { + function findTarget(vfs: VirtualFileSystem, target: string, set?: Set): VirtualEntry | undefined { const entry = vfs.getEntry(target); if (entry instanceof VirtualFileSymlink || entry instanceof VirtualDirectorySymlink) { - if (!set) set = new Set(); + if (!set) set = new Set(); if (set.has(entry)) return undefined; set.add(entry); - return findTarget(vfs, entry.target, set); + return findTarget(vfs, entry.targetPath, set); } return entry; } - function isMatch(entry: VirtualFile | VirtualDirectory, options: { pattern?: RegExp, kind?: "file" | "directory" }) { + function isMatch(entry: VirtualEntry, options: { pattern?: RegExp, kind?: "file" | "directory" }) { return (options.pattern === undefined || options.pattern.test(entry.name)) && (options.kind !== (entry instanceof VirtualFile ? "directory" : "file")); } +} +namespace Utils { // TODO(rbuckton): Move or retire this. - export class MockParseConfigHost extends VirtualFileSystem implements ts.ParseConfigHost { + export class MockParseConfigHost extends vfs.VirtualFileSystem implements ts.ParseConfigHost { constructor(currentDirectory: string, ignoreCase: boolean, files: ts.Map | string[]) { super(currentDirectory, ignoreCase); if (files instanceof Array) { diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index c16f57235e412..0175f2a77cb31 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -1,5 +1,7 @@ /// +// TODO(rbuckton): Migrate this to use vfs. + namespace ts.TestFSWithWatch { const { content: libFileContent } = Harness.getDefaultLibraryFile(Harness.IO); export const libFile: FileOrFolder = { diff --git a/src/harness/vpath.ts b/src/harness/vpath.ts index b2e98a4859fec..44783ccd229f3 100644 --- a/src/harness/vpath.ts +++ b/src/harness/vpath.ts @@ -1,10 +1,16 @@ /// - namespace vpath { - import compareStrings = ts.compareStrings; + // NOTE: Some of the functions here duplicate functionality from compiler/core.ts. They have been added + // to reduce the number of direct dependencies on compiler and services to eventually break away + // from depending directly on the compiler to speed up compilation time. + + import compareValues = collections.compareValues; + import compareStrings = collections.compareStrings; - export function normalizeSlashes(path: string): string { - return path.replace(/\s*[\\/]\s*/g, "/").trim(); + export const sep = "/"; + + export function normalizeSeparators(path: string): string { + return path.replace(/\s*[\\/]\s*/g, sep).trim(); } const rootRegExp = /^[\\/]([\\/](.*?[\\/](.*?[\\/])?)?)?|^[a-zA-Z]:[\\/]?|^\w+:\/{2}[^\\/]*\/?/; @@ -20,10 +26,18 @@ namespace vpath { const trailingSeperatorRegExp = /[\\/]$/; - export function hasTrailingSeperator(path: string) { + export function hasTrailingSeparator(path: string) { return trailingSeperatorRegExp.test(path); } + export function addTrailingSeparator(path: string) { + return hasTrailingSeparator(path) ? path : path + "/"; + } + + export function removeTrailingSeparator(path: string) { + return hasTrailingSeparator(path) ? path.slice(0, -1) : path; + } + function reduce(components: string[]) { const normalized = [components[0]]; for (let i = 1; i < components.length; i++) { @@ -41,20 +55,16 @@ namespace vpath { export function normalize(path: string): string { const components = reduce(parse(path)); - return components.length > 1 && hasTrailingSeperator(path) ? format(components) + "/" : format(components); + return components.length > 1 && hasTrailingSeparator(path) ? format(components) + sep : format(components); } export function combine(path: string, ...paths: string[]) { - path = normalizeSlashes(path); + path = normalizeSeparators(path); for (let name of paths) { - name = normalizeSlashes(name); + name = normalizeSeparators(name); if (name.length === 0) continue; - if (path.length === 0 || isAbsolute(name)) { - path = name; - } - else { - path = hasTrailingSeperator(path) ? path + name : path + "/" + name; - } + path = path.length === 0 || isAbsolute(name) ? name : + addTrailingSeparator(path) + name; } return path; } @@ -89,25 +99,65 @@ namespace vpath { return format(["", ...components]); } + export namespace relative { + export function caseSensitive(from: string, to: string) { return relative(from, to, /*ignoreCase*/ false); } + export function caseInsensitive(from: string, to: string) { return relative(from, to, /*ignoreCase*/ true); } + } + + export function compare(a: string, b: string, ignoreCase: boolean) { + if (!isAbsolute(a)) throw new Error("Path not absolute"); + if (!isAbsolute(b)) throw new Error("Path not absolute"); + if (a === b) return 0; + a = removeTrailingSeparator(a); + b = removeTrailingSeparator(b); + if (a === b) return 0; + const aComponents = reduce(parse(a)); + const bComponents = reduce(parse(b)); + const len = Math.min(aComponents.length, bComponents.length); + for (let i = 0; i < len; i++) { + const result = compareStrings(aComponents[i], bComponents[i], ignoreCase); + if (result !== 0) return result; + } + return compareValues(aComponents.length, bComponents.length); + } + + export namespace compare { + export function caseSensitive(a: string, b: string) { return compare(a, b, /*ignoreCase*/ false); } + export function caseInsensitive(a: string, b: string) { return compare(a, b, /*ignoreCase*/ true); } + } + + export function equals(a: string, b: string, ignoreCase: boolean) { + return compare(a, b, ignoreCase) === 0; + } + + export namespace equals { + export function caseSensitive(a: string, b: string) { return equals(a, b, /*ignoreCase*/ false); } + export function caseInsensitive(a: string, b: string) { return equals(a, b, /*ignoreCase*/ true); } + } + export function beneath(ancestor: string, descendant: string, ignoreCase: boolean) { if (!isAbsolute(ancestor)) throw new Error("Path not absolute"); if (!isAbsolute(descendant)) throw new Error("Path not absolute"); const ancestorComponents = reduce(parse(ancestor)); const descendantComponents = reduce(parse(descendant)); - + const len = Math.min(ancestorComponents.length, descendantComponents.length); let start: number; - for (start = 0; start < ancestorComponents.length && start < descendantComponents.length; start++) { + for (start = 0; start < len; start++) { if (compareStrings(ancestorComponents[start], descendantComponents[start], ignoreCase)) { break; } } - return start === ancestorComponents.length; } + export namespace beneath { + export function caseSensitive(ancestor: string, descendant: string) { return beneath(ancestor, descendant, /*ignoreCase*/ false); } + export function caseInsensitive(ancestor: string, descendant: string) { return beneath(ancestor, descendant, /*ignoreCase*/ true); } + } + export function parse(path: string) { - path = normalizeSlashes(path); + path = normalizeSeparators(path); const rootLength = getRootLength(path); const root = path.substring(0, rootLength); const rest = path.substring(rootLength).split(/\/+/g); @@ -116,19 +166,19 @@ namespace vpath { } export function format(components: string[]) { - return components.length ? components[0] + components.slice(1).join("/") : ""; + return components.length ? components[0] + components.slice(1).join(sep) : ""; } export function dirname(path: string) { - path = normalizeSlashes(path); - return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf("/"))); + path = normalizeSeparators(path); + return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(sep))); } export function basename(path: string, ext?: string): string; export function basename(path: string, options?: { extensions?: string[], ignoreCase?: boolean }): string; export function basename(path: string, options?: { extensions?: string[], ignoreCase?: boolean } | string) { - path = normalizeSlashes(path); - const name = path.substr(Math.max(getRootLength(path), path.lastIndexOf("/") + 1)); + path = normalizeSeparators(path); + const name = path.substr(Math.max(getRootLength(path), path.lastIndexOf(sep) + 1)); const extension = typeof options === "string" ? options.startsWith(".") ? options : "." + options : options && options.extensions ? extname(name, options) : undefined; @@ -136,6 +186,7 @@ namespace vpath { } const extRegExp = /\.\w+$/; + export function extname(path: string, options?: { extensions?: string[], ignoreCase?: boolean }) { if (options && options.extensions) { for (let extension of options.extensions) { @@ -153,9 +204,4 @@ namespace vpath { const match = extRegExp.exec(path); return match ? match[0] : ""; } - - export function chext(path: string, ext: string, options?: { extensions?: string[], ignoreCase?: boolean }) { - const pathext = extname(path, options); - return pathext ? path.slice(0, path.length - pathext.length) + (ext.startsWith(".") ? ext : "." + ext) : path; - } } \ No newline at end of file diff --git a/tests/webTestServer.ts b/tests/webTestServer.ts index 5a3b4cc504896..a1f1747adcb07 100644 --- a/tests/webTestServer.ts +++ b/tests/webTestServer.ts @@ -4,333 +4,767 @@ import http = require("http"); import fs = require("fs"); import path = require("path"); import url = require("url"); +import URL = url.URL; import child_process = require("child_process"); import os = require("os"); +import crypto = require("crypto"); -/// Command line processing /// +const port = 8888; // harness.ts and webTestResults.html depend on this exact port number. +const baseUrl = new URL(`http://localhost:8888/`); +const rootDir = path.dirname(__dirname); +const useCaseSensitiveFileNames = isFileSystemCaseSensitive(); + +let browser = "IE"; +let grep: string | undefined; +let verbose = false; -if (process.argv[2] == "--help") { - console.log("Runs a node server on port 8888, looking for tests folder in the current directory\n"); - console.log("Syntax: node nodeServer.js [typescriptEnlistmentDirectory] [tests] [--browser] [--verbose]\n"); - console.log("Examples: \n\tnode nodeServer.js ."); - console.log("\tnode nodeServer.js 3000 D:/src/typescript/public --verbose IE"); +interface HttpContent { + headers: any; + content: string; } -function switchToForwardSlashes(path: string) { - return path.replace(/\\/g, "/").replace(/\/\//g, "/"); +namespace HttpContent { + export function create(headers: object = {}, content?: string) { + return { headers, content }; + } + + export function clone(content: HttpContent): HttpContent { + return content && create(HttpHeaders.clone(content.headers), content.content); + } + + export function forMediaType(mediaType: string | string[], content: string): HttpContent { + return create({ "Content-Type": mediaType, "Content-Length": Buffer.byteLength(content, "utf8") }, content); + } + + export function text(content: string): HttpContent { + return forMediaType("text/plain", content); + } + + export function json(content: any): HttpContent { + return forMediaType("application/json", JSON.stringify(content)); + } } -const port = 8888; // harness.ts and webTestResults.html depend on this exact port number. +namespace HttpHeaders { + export function clone(headers: http.OutgoingHttpHeaders) { + return { ...headers }; + } -let browser: string; -if (process.argv[2]) { - browser = process.argv[2]; - if (browser !== "chrome" && browser !== "IE") { - console.log(`Invalid command line arguments. Got ${browser} but expected chrome, IE or nothing.`); + export function getCacheControl(headers: http.IncomingHttpHeaders | http.OutgoingHttpHeaders) { + let cacheControl = headers["Cache-Control"]; + let noCache = false; + let noStore = false; + let maxAge: number = undefined; + let maxStale: number = undefined; + let minFresh: number = undefined; + if (typeof cacheControl === "string") cacheControl = [cacheControl]; + if (Array.isArray(cacheControl)) { + for (const directive of cacheControl) { + if (directive === "no-cache") noCache = true; + else if (directive === "no-store") noStore = true; + else if (directive === "max-stale") maxStale = Infinity; + else if (/^no-cache=/.test(directive)) noCache = true; + else if (/^max-age=/.test(directive)) maxAge = +directive.slice(8).trim(); + else if (/^min-fresh=/.test(directive)) minFresh = +directive.slice(10).trim(); + else if (/^max-stale=/.test(directive)) maxStale = +directive.slice(10).trim(); + } + } + return { noCache, noStore, maxAge, maxStale, minFresh }; + } + + export function getExpires(headers: http.IncomingHttpHeaders | http.OutgoingHttpHeaders) { + const expires = headers["Expires"]; + if (typeof expires !== "string") return Infinity; + return new Date(expires).getTime(); } + + export function getIfConditions(headers: http.IncomingHttpHeaders): { ifMatch: "*" | string[], ifNoneMatch: "*" | string[], ifModifiedSince: Date, ifUnmodifiedSince: Date } { + const ifMatch = toMatch(headers["If-Match"]); + const ifNoneMatch = toMatch(headers["If-None-Match"]); + const ifModifiedSince = toDate(headers["If-Modified-Since"]); + const ifUnmodifiedSince = toDate(headers["If-Unmodified-Since"]); + return { ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince }; + + function toMatch(value: string | string[]) { + return typeof value === "string" && value !== "*" ? [value] : value; + } + + function toDate(value: string | string[]) { + return value ? new Date(Array.isArray(value) ? value[0] : value) : undefined; + } + } + + export function combine(left: http.OutgoingHttpHeaders, right: http.OutgoingHttpHeaders) { + return left && right ? { ...left, ...right } : + left ? { ...left } : + right ? { ...right } : + {}; + } +} + +interface HttpRequestMessage { + url: url.URL; + method: string; + headers: http.IncomingHttpHeaders; + content?: HttpContent; + file?: string; + stats?: fs.Stats; } -const grep = process.argv[3]; +namespace HttpRequestMessage { + export function create(method: string, url: URL | string, headers: http.IncomingHttpHeaders, content?: HttpContent) { + return { method, url: typeof url === "string" ? new URL(url, baseUrl) : url, headers, content }; + } -let verbose = false; -if (process.argv[4] == "--verbose") { - verbose = true; + export function getFile(message: HttpRequestMessage) { + return message.file || (message.file = path.join(rootDir, decodeURIComponent(message.url.pathname))); + } + + export function getStats(message: HttpRequestMessage, throwErrors?: boolean) { + return message.stats || (message.stats = throwErrors ? fs.statSync(getFile(message)) : tryStat(getFile(message))); + } + + export function readRequest(req: http.ServerRequest) { + return new Promise((resolve, reject) => { + let entityData: string | undefined; + req.setEncoding("utf8"); + req.on("data", (data: string) => { + if (entityData === undefined) { + entityData = data; + } + else { + entityData += data; + } + }); + req.on("end", () => { + const content = entityData !== undefined + ? HttpContent.forMediaType(req.headers["Content-Type"], entityData) + : undefined; + resolve(HttpRequestMessage.create(req.method, req.url, req.headers, content)); + }); + req.on("error", reject); + }); + } } -else if (process.argv[4] && process.argv[4] !== "--verbose") { - console.log(`Invalid command line arguments. Got ${process.argv[4]} but expected --verbose or nothing.`); + +interface HttpResponseMessage { + statusCode?: number; + statusMessage?: string; + headers: http.OutgoingHttpHeaders; + content?: HttpContent; } -/// Utils /// -function log(msg: string) { - if (verbose) { - console.log(msg); +namespace HttpResponseMessage { + export function create(statusCode: number, headers: http.OutgoingHttpHeaders = {}, content?: HttpContent) { + return { statusCode, headers, content }; + } + + export function clone(message: HttpResponseMessage): HttpResponseMessage { + return { + statusCode: message.statusCode, + statusMessage: message.statusMessage, + headers: HttpHeaders.clone(message.headers), + content: HttpContent.clone(message.content) + }; + } + + export function ok(headers: http.OutgoingHttpHeaders, content: HttpContent | undefined): HttpResponseMessage; + export function ok(content?: HttpContent): HttpResponseMessage; + export function ok(contentOrHeaders: http.OutgoingHttpHeaders | HttpContent | undefined, content?: HttpContent): HttpResponseMessage { + let headers: http.OutgoingHttpHeaders; + if (!content) { + content = contentOrHeaders; + headers = {}; + } + return create(200, headers, content); + } + + export function created(location?: string, etag?: string): HttpResponseMessage { + return create(201, { "Location": location, "ETag": etag }); + } + + export function noContent(headers?: http.OutgoingHttpHeaders): HttpResponseMessage { + return create(204, headers); + } + + export function notModified(): HttpResponseMessage { + return create(304); + } + + export function badRequest(): HttpResponseMessage { + return create(400); + } + + export function notFound(): HttpResponseMessage { + return create(404); + } + + export function methodNotAllowed(allowedMethods: string[]): HttpResponseMessage { + return create(405, { "Allow": allowedMethods }); + } + + export function preconditionFailed(): HttpResponseMessage { + return create(412); + } + + export function unsupportedMediaType(): HttpResponseMessage { + return create(415); + } + + export function internalServerError(content?: HttpContent): HttpResponseMessage { + return create(500, {}, content); + } + + export function notImplemented(): HttpResponseMessage { + return create(501); + } + + export function setHeaders(obj: HttpResponseMessage | HttpContent, headers: http.OutgoingHttpHeaders) { + Object.assign(obj.headers, headers); + } + + export function writeResponse(message: HttpResponseMessage, response: http.ServerResponse) { + const content = message.content; + const headers = HttpHeaders.combine(message.headers, content && content.headers); + response.writeHead(message.statusCode, message.statusMessage || http.STATUS_CODES[message.statusCode], headers); + response.end(content && content.content, "utf8"); } } +namespace HttpFileMessageHandler { + function handleGetRequest(request: HttpRequestMessage): HttpResponseMessage { + const file = HttpRequestMessage.getFile(request); + const stat = HttpRequestMessage.getStats(request); + const etag = ETag.compute(stat); + const headers: http.OutgoingHttpHeaders = { + "Last-Modified": stat.mtime.toUTCString(), + "ETag": etag + }; + + let content: HttpContent | undefined; + if (stat.isFile()) { + if (request.method === "HEAD") { + headers["Content-Type"] = guessMediaType(file); + headers["Content-Length"] = stat.size; + } + else { + content = HttpContent.forMediaType(guessMediaType(file), fs.readFileSync(file, "utf8")); + } + } + else { + return HttpResponseMessage.notFound(); + } -const directorySeparator = "/"; + return HttpResponseMessage.ok(headers, content); + } + + function handlePutRequest(request: HttpRequestMessage): HttpResponseMessage { + if (request.headers["Content-Encoding"]) return HttpResponseMessage.unsupportedMediaType(); + if (request.headers["Content-Range"]) return HttpResponseMessage.notImplemented(); -function getRootLength(path: string): number { - if (path.charAt(0) === directorySeparator) { - if (path.charAt(1) !== directorySeparator) return 1; - const p1 = path.indexOf("/", 2); - if (p1 < 0) return 2; - const p2 = path.indexOf("/", p1 + 1); - if (p2 < 0) return p1 + 1; - return p2 + 1; + const file = toLocalPath(request.url); + const exists = fs.existsSync(file); + mkdir(path.dirname(file)); + fs.writeFileSync(file, request.content, "utf8"); + return exists ? HttpResponseMessage.noContent() : HttpResponseMessage.created(); } - if (path.charAt(1) === ":") { - if (path.charAt(2) === directorySeparator) return 3; - return 2; + + function handleDeleteRequest(request: HttpRequestMessage): HttpResponseMessage { + const file = HttpRequestMessage.getFile(request); + const stats = HttpRequestMessage.getStats(request); + if (stats.isFile()) { + fs.unlinkSync(file); + } + else if (stats.isDirectory()) { + fs.rmdirSync(file); + } + + return HttpResponseMessage.noContent(); } - // Per RFC 1738 'file' URI schema has the shape file:/// - // if is omitted then it is assumed that host value is 'localhost', - // however slash after the omitted is not removed. - // file:///folder1/file1 - this is a correct URI - // file://folder2/file2 - this is an incorrect URI - if (path.lastIndexOf("file:///", 0) === 0) { - return "file:///".length; + + function handleOptionsRequest(request: HttpRequestMessage): HttpResponseMessage { + return HttpResponseMessage.noContent({ + "X-Case-Sensitivity": useCaseSensitiveFileNames ? "CS" : "CI" + }); } - const idx = path.indexOf("://"); - if (idx !== -1) { - return idx + "://".length; + + function handleRequestCore(request: HttpRequestMessage): HttpResponseMessage { + switch (request.method) { + case "HEAD": + case "GET": + return handleGetRequest(request); + case "PUT": + return handlePutRequest(request); + case "DELETE": + return handleDeleteRequest(request); + case "OPTIONS": + return handleOptionsRequest(request); + default: + return HttpResponseMessage.methodNotAllowed(["HEAD", "GET", "PUT", "DELETE", "OPTIONS"]); + } + } + + export function handleRequest(request: HttpRequestMessage): HttpResponseMessage { + let response = HttpCache.get(request); + if (!response) HttpCache.set(request, response = handleRequestCore(request)); + return response; } - return 0; } -function getDirectoryPath(path: string): any { - path = switchToForwardSlashes(path); - return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(directorySeparator))); +namespace HttpApiMessageHandler { + function handleResolveRequest(request: HttpRequestMessage): HttpResponseMessage { + if (!request.content) return HttpResponseMessage.badRequest(); + const localPath = path.resolve(rootDir, request.content.content); + const relativePath = toURLPath(localPath); + return relativePath === undefined + ? HttpResponseMessage.badRequest() + : HttpResponseMessage.ok(HttpContent.text(relativePath)); + } + + function handleListFilesRequest(request: HttpRequestMessage): HttpResponseMessage { + if (!request.content) return HttpResponseMessage.badRequest(); + const localPath = path.resolve(rootDir, request.content.content); + const files: string[] = []; + visit(localPath, files); + return HttpResponseMessage.ok(HttpContent.json(files)); + + function visit(dirname: string, results: string[]) { + const { files, directories } = getAccessibleFileSystemEntries(dirname); + for (const file of files) { + results.push(toURLPath(path.join(dirname, file))); + } + for (const directory of directories) { + visit(path.join(dirname, directory), results); + } + } + } + + function handleDirectoryExistsRequest(request: HttpRequestMessage): HttpResponseMessage { + if (!request.content) return HttpResponseMessage.badRequest(); + const localPath = path.resolve(rootDir, request.content.content); + return HttpResponseMessage.ok(HttpContent.json(directoryExists(localPath))); + } + + function handlePostRequest(request: HttpRequestMessage): HttpResponseMessage { + switch (request.url.pathname) { + case "/api/resolve": + return handleResolveRequest(request); + case "/api/listFiles": + return handleListFilesRequest(request); + case "/api/directoryExists": + return handleDirectoryExistsRequest(request); + default: + return HttpResponseMessage.notFound(); + } + } + + export function handleRequest(request: HttpRequestMessage): HttpResponseMessage { + switch (request.method) { + case "POST": + return handlePostRequest(request); + default: + return HttpResponseMessage.methodNotAllowed(["POST"]); + } + } + + export function match(request: HttpRequestMessage) { + return /^\/api\//.test(request.url.pathname); + } } -function ensureDirectoriesExist(path: string) { - path = switchToForwardSlashes(path); - if (path.length > getRootLength(path) && !fs.existsSync(path)) { - const parentDirectory = getDirectoryPath(path); - ensureDirectoriesExist(parentDirectory); - if (!fs.existsSync(path)) { - fs.mkdirSync(path); +namespace HttpMessageHandler { + export function handleRequest(request: HttpRequestMessage): HttpResponseMessage { + const { ifMatch, ifNoneMatch, ifModifiedSince, ifUnmodifiedSince } = HttpHeaders.getIfConditions(request.headers); + const stats = HttpRequestMessage.getStats(request, /*throwErrors*/ false); + if (stats) { + const etag = ETag.compute(stats); + if (ifNoneMatch) { + if (ETag.matches(etag, ifNoneMatch)) { + return HttpResponseMessage.notModified(); + } + } + else if (ifModifiedSince && stats.mtime.getTime() <= ifModifiedSince.getTime()) { + return HttpResponseMessage.notModified(); + } + + if (ifMatch && !ETag.matches(etag, ifMatch)) { + return HttpResponseMessage.preconditionFailed(); + } + + if (ifUnmodifiedSince && stats.mtime.getTime() > ifUnmodifiedSince.getTime()) { + return HttpResponseMessage.preconditionFailed(); + } + } + else if (ifMatch === "*") { + return HttpResponseMessage.preconditionFailed(); + } + + if (HttpApiMessageHandler.match(request)) { + return HttpApiMessageHandler.handleRequest(request); + } + else { + return HttpFileMessageHandler.handleRequest(request); + } + } + + export function handleError(e: any): HttpResponseMessage { + switch (e.code) { + case "ENOENT": return HttpResponseMessage.notFound(); + default: return HttpResponseMessage.internalServerError(HttpContent.text(e.toString())); } } } -// Copied from the compiler sources -function dir(dirPath: string, spec?: string, options?: any) { - options = options || <{ recursive?: boolean; }>{}; - return filesInFolder(dirPath); +namespace HttpCache { + interface CacheEntry { + timestamp: number; + expires: number; + response: HttpResponseMessage; + } - function filesInFolder(folder: string): string[] { - folder = switchToForwardSlashes(folder); - let paths: string[] = []; - // Everything after the current directory is relative - const baseDirectoryLength = process.cwd().length + 1; + const cache: Record = Object.create(null); - try { - const files = fs.readdirSync(folder); - for (let i = 0; i < files.length; i++) { - const stat = fs.statSync(path.join(folder, files[i])); - if (options.recursive && stat.isDirectory()) { - paths = paths.concat(filesInFolder(path.join(folder, files[i]))); - } - else if (stat.isFile() && (!spec || files[i].match(spec))) { - const relativePath = folder.substring(baseDirectoryLength); - paths.push(path.join(relativePath, files[i])); - } + export function get(request: HttpRequestMessage) { + if (request.method !== "GET" && request.method !== "HEAD") return undefined; + + const cacheControl = HttpHeaders.getCacheControl(request.headers); + if (cacheControl.noCache) return undefined; + + const entry = cache[request.url.toString()]; + if (!entry) return undefined; + + const age = (Date.now() - entry.timestamp) / 1000; + const lifetime = (entry.expires - Date.now()) / 1000; + + if (cacheControl.maxAge !== undefined && cacheControl.maxAge < age) return undefined; + if (lifetime >= 0) { + if (cacheControl.minFresh !== undefined && cacheControl.minFresh < lifetime) return undefined; + } + else { + if (cacheControl.maxStale === undefined || cacheControl.maxStale < -lifetime) { + return undefined; } } - catch (err) { - // Skip folders that are inaccessible + + if (request.method === "GET" && !entry.response.content) { + return undefined; // partial response + } + + const response = HttpResponseMessage.clone(entry.response); + response.headers["Age"] = Math.floor(age); + return response; + } + + export function set(request: HttpRequestMessage, response: HttpResponseMessage) { + if (request.method !== "GET" && request.method !== "HEAD") return response; + + const cacheControl = HttpHeaders.getCacheControl(request.headers); + if (cacheControl.noCache) return response; + if (cacheControl.noStore) return response; + + const timestamp = Date.now(); + const expires = HttpHeaders.getExpires(response.headers); + const age = (Date.now() - timestamp) / 1000; + const lifetime = (expires - Date.now()) / 1000; + + if (cacheControl.maxAge !== undefined && cacheControl.maxAge < age) return response; + if (lifetime >= 0) { + if (cacheControl.minFresh !== undefined && cacheControl.minFresh < lifetime) return response; + } + else { + if (cacheControl.maxStale === undefined || cacheControl.maxStale < -lifetime) return response; + } + + cache[request.url.toString()] = { + timestamp, + expires, + response: HttpResponseMessage.clone(response) + }; + + response.headers["Age"] = Math.floor(age); + return response; + } + + function cleanupCache() { + for (const url in cache) { + const entry = cache[url]; + if (entry.expires < Date.now()) delete cache[url]; } - return paths; } + + setInterval(cleanupCache, 60000).unref(); } -function writeFile(path: string, data: any) { - ensureDirectoriesExist(getDirectoryPath(path)); - fs.writeFileSync(path, data); +namespace ETag { + export function compute(stats: fs.Stats) { + return JSON.stringify(crypto + .createHash("sha1") + .update(JSON.stringify({ + dev: stats.dev, + ino: stats.ino, + mtime: stats.mtimeMs, + size: stats.size + })) + .digest("base64")); + } + + export function matches(etag: string | undefined, condition: "*" | string[]) { + return etag && condition === "*" || condition.indexOf(etag) >= 0; + } } -/// Request Handling /// +function isFileSystemCaseSensitive(): boolean { + // win32\win64 are case insensitive platforms + const platform = os.platform(); + if (platform === "win32" || platform === "win64") { + return false; + } + // If this file exists under a different case, we must be case-insensitve. + return !fs.existsSync(swapCase(__filename)); +} -function handleResolutionRequest(filePath: string, res: http.ServerResponse) { - let resolvedPath = path.resolve(filePath, ""); - resolvedPath = resolvedPath.substring(resolvedPath.indexOf("tests")); - resolvedPath = switchToForwardSlashes(resolvedPath); - send(ResponseCode.Success, res, resolvedPath); +function swapCase(s: string): string { + return s.replace(/\w/g, (ch) => { + const up = ch.toUpperCase(); + return ch === up ? ch.toLowerCase() : up; + }); } -const enum ResponseCode { - Success = 200, - BadRequest = 400, - NotFound = 404, - MethodNotAllowed = 405, - PayloadTooLarge = 413, - Fail = 500 +function hasLeadingSeparator(pathname: string) { + const ch = pathname.charAt(0); + return ch === "/" || ch === "\\"; } -function send(responseCode: number, res: http.ServerResponse, contents: string, contentType = "binary"): void { - res.writeHead(responseCode, { "Content-Type": contentType }); - res.end(contents); +function ensureLeadingSeparator(pathname: string) { + return hasLeadingSeparator(pathname) ? pathname : "/" + pathname; } -// Reads the data from a post request and passes it to the given callback -function processPost(req: http.ServerRequest, res: http.ServerResponse, callback: (data: string) => any): void { - let queryData = ""; - if (typeof callback !== "function") return; +function trimLeadingSeparator(pathname: string) { + return hasLeadingSeparator(pathname) ? pathname.slice(1) : pathname; +} - if (req.method == "POST") { - req.on("data", (data: string) => { - queryData += data; - if (queryData.length > 1e8) { - queryData = ""; - send(ResponseCode.PayloadTooLarge, res, undefined); - console.log("ERROR: destroying connection"); - req.connection.destroy(); - } - }); +function normalizeSlashes(path: string) { + return path.replace(/\\+/g, "/"); +} - req.on("end", () => { - // res.post = url.parse(req.url).query; - callback(queryData); - }); +function hasTrailingSeparator(pathname: string) { + const ch = pathname.charAt(pathname.length - 1); + return ch === "/" || ch === "\\"; +} +function toLocalPath(url: url.URL) { + const pathname = decodeURIComponent(url.pathname); + return path.join(rootDir, pathname); +} + +function toURLPath(pathname: string) { + pathname = normalizeSlashes(pathname); + pathname = trimLeadingSeparator(pathname); + + const resolvedPath = path.resolve(rootDir, pathname); + if (resolvedPath.slice(0, rootDir.length) !== rootDir) { + return undefined; } - else { - send(ResponseCode.MethodNotAllowed, res, undefined); - } + + let relativePath = resolvedPath.slice(rootDir.length); + relativePath = ensureLeadingSeparator(relativePath); + relativePath = normalizeSlashes(relativePath); + return relativePath; } -enum RequestType { - GetFile, - GetDir, - ResolveFile, - WriteFile, - DeleteFile, - WriteDir, - DeleteDir, - AppendFile, - Unknown +function directoryExists(dirname: string) { + const stat = tryStat(dirname); + return !!stat && stat.isDirectory(); } -function getRequestOperation(req: http.ServerRequest) { - if (req.method === "GET" && req.url.indexOf("?") === -1) { - if (req.url.indexOf(".") !== -1) return RequestType.GetFile; - else return RequestType.GetDir; +function mkdir(dirname: string) { + try { + fs.mkdirSync(dirname); } - else { + catch (e) { + if (e.code === "EEXIST") { + return; + } + if (e.code === "ENOENT") { + const parentdir = path.dirname(dirname); + if (!parentdir || parentdir === dirname) throw e; + mkdir(parentdir); + fs.mkdirSync(dirname); + return; + } + throw e; + } +} + +function tryStat(pathname: string) { + try { + return fs.statSync(pathname); + } + catch (e) { + return undefined; + } +} + +function getAccessibleFileSystemEntries(pathname: string) { + try { + const entries = fs.readdirSync(pathname).sort(); + const files: string[] = []; + const directories: string[] = []; + for (const entry of entries) { + // This is necessary because on some file system node fails to exclude + // "." and "..". See https://github.com/nodejs/node/issues/4002 + if (entry === "." || entry === "..") { + continue; + } + const name = path.join(pathname, entry); - const queryData: any = url.parse(req.url, /*parseQueryString*/ true).query; - if (req.method === "GET" && queryData.resolve !== undefined) return RequestType.ResolveFile; - // mocha uses ?grep= query string as equivalent to the --grep command line option used to filter tests - if (req.method === "GET" && queryData.grep !== undefined) return RequestType.GetFile; - if (req.method === "POST" && queryData.action) { - const path = req.url.substr(0, req.url.lastIndexOf("?")); - const isFile = path.substring(path.lastIndexOf("/")).indexOf(".") !== -1; - switch (queryData.action.toUpperCase()) { - case "WRITE": - return isFile ? RequestType.WriteFile : RequestType.WriteDir; - case "DELETE": - return isFile ? RequestType.DeleteFile : RequestType.DeleteDir; - case "APPEND": - return isFile ? RequestType.AppendFile : RequestType.Unknown; + let stat: fs.Stats; + try { + stat = fs.statSync(name); + } + catch (e) { + continue; + } + + if (stat.isFile()) { + files.push(entry); + } + else if (stat.isDirectory()) { + directories.push(entry); } } - return RequestType.Unknown; + return { files, directories }; + } + catch (e) { + return { files: [], directories: [] }; } } -function handleRequestOperation(req: http.ServerRequest, res: http.ServerResponse, operation: RequestType, reqPath: string) { - switch (operation) { - case RequestType.GetDir: - const filesInFolder = dir(reqPath, "", { recursive: true }); - send(ResponseCode.Success, res, filesInFolder.join(",")); - break; - case RequestType.GetFile: - fs.readFile(reqPath, (err, file) => { - const contentType = contentTypeForExtension(path.extname(reqPath)); - if (err) { - send(ResponseCode.NotFound, res, err.message, contentType); - } - else { - send(ResponseCode.Success, res, file, contentType); - } - }); - break; - case RequestType.ResolveFile: - const resolveRequest = req.url.match(/(.*)\?resolve/); - handleResolutionRequest(resolveRequest[1], res); - break; - case RequestType.WriteFile: - processPost(req, res, (data) => { - writeFile(reqPath, data); - }); - send(ResponseCode.Success, res, undefined); - break; - case RequestType.WriteDir: - fs.mkdirSync(reqPath); - send(ResponseCode.Success, res, undefined); - break; - case RequestType.DeleteFile: - if (fs.existsSync(reqPath)) { - fs.unlinkSync(reqPath); +function log(msg: string) { + if (verbose) { + console.log(msg); + } +} + +function guessMediaType(pathname: string) { + switch (path.extname(pathname).toLowerCase()) { + case ".html": return "text/html"; + case ".css": return "text/css"; + case ".js": return "application/javascript"; + case ".ts": return "text/plain"; + case ".json": return "text/plain"; + default: return "binary"; + } +} + +function printHelp() { + console.log("Runs an http server on port 8888, looking for tests folder in the current directory\n"); + console.log("Syntax: node webTestServer.js [browser] [tests] [--verbose]\n"); + console.log("Options:"); + console.log(" The browser to launch. One of 'IE', 'chrome', or 'none' (default 'IE')."); + console.log(" A regular expression to pass to Mocha."); + console.log(" --verbose Enables verbose logging.") +} + +function parseCommandLine(args: string[]) { + let offset = 0; + for (let i = 0; i < args.length; i++) { + const arg = args[i]; + const argLower = arg.toLowerCase(); + if (argLower === "--help") { + printHelp(); + return false; + } + else if (argLower === "--verbose") { + verbose = true; + } + else { + if (offset === 0) { + browser = arg; } - send(ResponseCode.Success, res, undefined); - break; - case RequestType.DeleteDir: - if (fs.existsSync(reqPath)) { - fs.rmdirSync(reqPath); + else if (offset === 1) { + grep = arg; } - send(ResponseCode.Success, res, undefined); - break; - case RequestType.AppendFile: - processPost(req, res, (data) => { - fs.appendFileSync(reqPath, data); - }); - send(ResponseCode.Success, res, undefined); - break; - case RequestType.Unknown: - default: - send(ResponseCode.BadRequest, res, undefined); - break; - } - - function contentTypeForExtension(ext: string) { - switch (ext) { - case ".js": return "text/javascript"; - case ".css": return "text/css"; - case ".html": return "text/html"; - default: return "binary"; - } - } -} - -console.log(`Static file server running at\n => http://localhost:${port}/\nCTRL + C to shutdown`); - -http.createServer((req: http.ServerRequest, res: http.ServerResponse) => { - log(`${req.method} ${req.url}`); - const uri = decodeURIComponent(url.parse(req.url).pathname); - const reqPath = path.join(process.cwd(), uri); - const operation = getRequestOperation(req); - handleRequestOperation(req, res, operation, reqPath); -}).listen(port); - -let browserPath: string; -if (browser === "chrome") { - let defaultChromePath = ""; - switch (os.platform()) { - case "win32": - defaultChromePath = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"; - break; - case "darwin": - defaultChromePath = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; - break; - case "linux": - defaultChromePath = "/opt/google/chrome/chrome"; - break; - default: - console.log(`default Chrome location is unknown for platform '${os.platform()}'`); - break; - } - if (fs.existsSync(defaultChromePath)) { - browserPath = defaultChromePath; + else { + console.log(`Unrecognized argument: ${arg}\n`); + return false; + } + offset++; + } } - else { - browserPath = browser; + + if (browser !== "IE" && browser !== "chrome") { + console.log(`Unrecognized browser '${browser}', expected 'IE' or 'chrome'.`); + return false; } + + return true; +} + +function startServer() { + console.log(`Static file server running at\n => http://localhost:${port}/\nCTRL + C to shutdown`); + http.createServer((serverRequest: http.ServerRequest, serverResponse: http.ServerResponse) => { + log(`${serverRequest.method} ${serverRequest.url}`); + HttpRequestMessage + .readRequest(serverRequest) + .then(HttpMessageHandler.handleRequest) + .catch(HttpMessageHandler.handleError) + .then(response => HttpResponseMessage.writeResponse(response, serverResponse)); + }).listen(port); } -else { - const defaultIEPath = "C:/Program Files/Internet Explorer/iexplore.exe"; - if (fs.existsSync(defaultIEPath)) { - browserPath = defaultIEPath; + +function startClient() { + let browserPath: string; + if (browser === "none") { + return; + } + + if (browser === "chrome") { + let defaultChromePath = ""; + switch (os.platform()) { + case "win32": + defaultChromePath = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe"; + break; + case "darwin": + defaultChromePath = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; + break; + case "linux": + defaultChromePath = "/opt/google/chrome/chrome"; + break; + default: + console.log(`default Chrome location is unknown for platform '${os.platform()}'`); + break; + } + if (fs.existsSync(defaultChromePath)) { + browserPath = defaultChromePath; + } + else { + browserPath = browser; + } } else { - browserPath = browser; + const defaultIEPath = "C:/Program Files/Internet Explorer/iexplore.exe"; + if (fs.existsSync(defaultIEPath)) { + browserPath = defaultIEPath; + } + else { + browserPath = browser; + } } + + console.log(`Using browser: ${browserPath}`); + + const queryString = grep ? `?grep=${grep}` : ""; + child_process.spawn(browserPath, [`http://localhost:${port}/tests/webTestResults.html${queryString}`], { + stdio: "inherit" + }); } -console.log(`Using browser: ${browserPath}`); +function main() { + if (parseCommandLine(process.argv.slice(2))) { + startServer(); + startClient(); + } +} -const queryString = grep ? `?grep=${grep}` : ""; -child_process.spawn(browserPath, [`http://localhost:${port}/tests/webTestResults.html${queryString}`], { - stdio: "inherit" -}); +main(); \ No newline at end of file From 560cffdefece8251f026ae32e7a58f4950c5f127 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 19 Oct 2017 18:04:57 -0700 Subject: [PATCH 03/54] Minor cleanup --- src/harness/vfs.ts | 111 +++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index 42ac54b076f6d..6f32477d60f7e 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -5,7 +5,7 @@ /// namespace vfs { import compareStrings = collections.compareStrings; - import KeyedCollection = collections.SortedCollection; + import SortedCollection = collections.SortedCollection; import Metadata = collections.Metadata; import EventEmitter = events.EventEmitter; import IO = Harness.IO; @@ -123,8 +123,8 @@ namespace vfs { private _currentDirectory: string; private _currentDirectoryStack: string[] | undefined; private _shadowRoot: VirtualFileSystem | undefined; - private _watchedFiles: KeyedCollection | undefined; - private _watchedDirectories: KeyedCollection | undefined; + private _watchedFiles: SortedCollection | undefined; + private _watchedDirectories: SortedCollection | undefined; private _onRootFileSystemChange: (path: string, change: FileSystemChange) => void; constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean) { @@ -134,6 +134,18 @@ namespace vfs { this._onRootFileSystemChange = (path, change) => this.onRootFileSystemChange(path, change); } + public get stringComparer() { + return this.useCaseSensitiveFileNames + ? compareStrings.caseSensitive + : compareStrings.caseInsensitive; + } + + public get pathComparer() { + return this.useCaseSensitiveFileNames + ? vpath.compare.caseSensitive + : vpath.compare.caseInsensitive; + } + /** * Gets the file system shadowed by this instance. */ @@ -207,13 +219,6 @@ namespace vfs { return vfs; } - /** - * Gets a value indicating whether to file names are equivalent for the file system's case sensitivity. - */ - public sameName(a: string, b: string) { - return compareStrings(a, b, !this.useCaseSensitiveFileNames) === 0; - } - /** * Changes the current directory to the supplied path. */ @@ -405,7 +410,7 @@ namespace vfs { public watchFile(path: string, watcher: (path: string, change: FileSystemChange) => void): ts.FileWatcher { if (!this._watchedFiles) { const pathComparer = this.useCaseSensitiveFileNames ? vpath.compare.caseSensitive : vpath.compare.caseInsensitive; - this._watchedFiles = new KeyedCollection(pathComparer); + this._watchedFiles = new SortedCollection(pathComparer); } path = vpath.resolve(this.currentDirectory, path); @@ -434,7 +439,7 @@ namespace vfs { public watchDirectory(path: string, watcher: (path: string) => void, recursive?: boolean) { if (!this._watchedDirectories) { const pathComparer = this.useCaseSensitiveFileNames ? vpath.compare.caseSensitive : vpath.compare.caseInsensitive; - this._watchedDirectories = new KeyedCollection(pathComparer); + this._watchedDirectories = new SortedCollection(pathComparer); } path = vpath.resolve(this.currentDirectory, path); @@ -636,7 +641,7 @@ namespace vfs { export class VirtualDirectory extends VirtualFileSystemEntry { protected _shadowRoot: VirtualDirectory | undefined; private _parent: VirtualDirectory; - private _entries: KeyedCollection | undefined; + private _entries: SortedCollection | undefined; private _resolver: FileSystemResolver | undefined; private _onChildFileSystemChange: (path: string, change: FileSystemChange) => void; @@ -902,7 +907,7 @@ namespace vfs { protected getOwnEntries() { if (!this._entries) { - const entries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); + const entries = new SortedCollection(this.fileSystem.stringComparer); const resolver = this._resolver; const shadowRoot = this._shadowRoot; if (resolver) { @@ -1048,8 +1053,8 @@ namespace vfs { export class VirtualDirectorySymlink extends VirtualDirectory { private _targetPath: string; private _target: VirtualDirectory | undefined; - private _pullEntries: KeyedCollection | undefined; - private _allEntries: KeyedCollection | undefined; + private _views: SortedCollection | undefined; + private _allViews: SortedCollection | undefined; private _onTargetParentChildRemoved: (entry: VirtualEntry) => void; private _onTargetChildRemoved: (entry: VirtualEntry) => void; private _onTargetChildAdded: (entry: VirtualEntry) => void; @@ -1057,7 +1062,7 @@ namespace vfs { constructor(parent: VirtualDirectory, name: string, target: string) { super(parent, name); - this._pullEntries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); + this._views = new SortedCollection(this.fileSystem.stringComparer); this._targetPath = target; this._onTargetParentChildRemoved = entry => this.onTargetParentChildRemoved(entry); this._onTargetChildAdded = entry => this.onTargetChildAdded(entry); @@ -1110,66 +1115,66 @@ namespace vfs { } protected addOwnDirectory(name: string, resolver?: FileSystemResolver): VirtualDirectory | undefined { - const realTarget = this.target; - const child = realTarget && realTarget.addDirectory(name, resolver); + const target = this.target; + const child = target && target.addDirectory(name, resolver); return child && this.getView(child); } protected addOwnFile(name: string, content?: FileSystemResolver | ContentResolver | string): VirtualFile | undefined { - const realTarget = this.target; - const child = realTarget && realTarget.addFile(name, content); + const target = this.target; + const child = target && target.addFile(name, content); return child && this.getView(child); } - protected addOwnSymlink(name: string, target: VirtualEntry): VirtualSymlink | undefined { - const realTarget = this.target; - const child = realTarget && realTarget.addSymlink(name, target); + protected addOwnSymlink(name: string, linkTarget: VirtualEntry): VirtualSymlink | undefined { + const target = this.target; + const child = target && target.addSymlink(name, linkTarget); return child && this.getView(child); } protected removeOwnDirectory(name: string): boolean { - const realTarget = this.target; - return realTarget && realTarget.removeDirectory(name) || false; + const target = this.target; + return target && target.removeDirectory(name) || false; } protected removeOwnFile(name: string): boolean { - const realTarget = this.target; - return realTarget && realTarget.removeFile(name) || false; + const target = this.target; + return target && target.removeFile(name) || false; } - protected getOwnEntries(): KeyedCollection { - if (!this._allEntries) { - const realTarget = this.target; - this._allEntries = new KeyedCollection(this.fileSystem.useCaseSensitiveFileNames ? compareStrings.caseSensitive : compareStrings.caseInsensitive); - if (realTarget) { - for (const entry of realTarget.getEntries()) { - this._allEntries.set(entry.name, this.getView(entry)); + protected getOwnEntries(): SortedCollection { + if (!this._allViews) { + this._allViews = new SortedCollection(this.fileSystem.stringComparer); + const target = this.target; + if (target) { + for (const entry of target.getEntries()) { + this._allViews.set(entry.name, this.getView(entry)); } } } - return this._allEntries; + return this._allViews; } private getView(entry: VirtualFile): VirtualFileView; private getView(entry: VirtualDirectory): VirtualDirectoryView; private getView(entry: VirtualEntry): VirtualEntryView; private getView(entry: VirtualEntry) { - let symlink = this._pullEntries.get(entry.name); + let view = this._views.get(entry.name); if (entry instanceof VirtualFile) { - if (symlink instanceof VirtualFileView) { - return symlink; + if (view instanceof VirtualFileView) { + return view; } - symlink = new VirtualFileView(this, entry.name, entry.path); - this._pullEntries.set(entry.name, symlink); + view = new VirtualFileView(this, entry.name, entry.path); + this._views.set(entry.name, view); } else { - if (symlink instanceof VirtualDirectoryView) { - return symlink; + if (view instanceof VirtualDirectoryView) { + return view; } - symlink = new VirtualDirectoryView(this, entry.name, entry.path); - this._pullEntries.set(entry.name, symlink); + view = new VirtualDirectoryView(this, entry.name, entry.path); + this._views.set(entry.name, view); } - return symlink; + return view; } private resolveTarget(): void { @@ -1192,8 +1197,8 @@ namespace vfs { this._target.removeListener("childRemoved", this._onTargetChildRemoved); this._target.removeListener("fileSystemChange", this._onTargetFileSystemChange); this._target = undefined; - this._pullEntries.clear(); - this._allEntries = undefined; + this._views.clear(); + this._allViews = undefined; } private onTargetParentChildRemoved(entry: VirtualEntry) { @@ -1211,7 +1216,7 @@ namespace vfs { private onTargetChildRemoved(entry: VirtualEntry) { const symlink = this.getView(entry); this.getOwnEntries().delete(entry.name); - this._pullEntries.delete(entry.name); + this._views.delete(entry.name); this.emit("childRemoved", symlink); } @@ -1411,16 +1416,16 @@ namespace vfs { * Gets the text content of this file. */ public get content(): string | undefined { - const realTarget = this.target; - return realTarget && realTarget.content; + const target = this.target; + return target && target.content; } /** * Sets the text content of this file. */ public set content(value: string | undefined) { - const realTarget = this.target; - if (realTarget) realTarget.content = value; + const target = this.target; + if (target) target.content = value; } /** From db6794a4f4e78d2ee45eab0ac76700814920a920 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 19 Oct 2017 18:06:48 -0700 Subject: [PATCH 04/54] Minor cleanup --- src/harness/collections.ts | 4 ++-- src/harness/vfs.ts | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/harness/collections.ts b/src/harness/collections.ts index 7d661cdeacc42..8bdbb453c9835 100644 --- a/src/harness/collections.ts +++ b/src/harness/collections.ts @@ -53,9 +53,9 @@ namespace collections { } /** - * A collection of key/value pairs sorted by key. + * A collection of key/value pairs internally sorted by key. */ - export class SortedCollection { + export class KeyedCollection { private _comparer: (a: K, b: K) => number; private _keys: K[] = []; private _values: V[] = []; diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index 6f32477d60f7e..dbdb685d1af0c 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -5,7 +5,7 @@ /// namespace vfs { import compareStrings = collections.compareStrings; - import SortedCollection = collections.SortedCollection; + import KeyedCollection = collections.KeyedCollection; import Metadata = collections.Metadata; import EventEmitter = events.EventEmitter; import IO = Harness.IO; @@ -123,8 +123,8 @@ namespace vfs { private _currentDirectory: string; private _currentDirectoryStack: string[] | undefined; private _shadowRoot: VirtualFileSystem | undefined; - private _watchedFiles: SortedCollection | undefined; - private _watchedDirectories: SortedCollection | undefined; + private _watchedFiles: KeyedCollection | undefined; + private _watchedDirectories: KeyedCollection | undefined; private _onRootFileSystemChange: (path: string, change: FileSystemChange) => void; constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean) { @@ -410,7 +410,7 @@ namespace vfs { public watchFile(path: string, watcher: (path: string, change: FileSystemChange) => void): ts.FileWatcher { if (!this._watchedFiles) { const pathComparer = this.useCaseSensitiveFileNames ? vpath.compare.caseSensitive : vpath.compare.caseInsensitive; - this._watchedFiles = new SortedCollection(pathComparer); + this._watchedFiles = new KeyedCollection(pathComparer); } path = vpath.resolve(this.currentDirectory, path); @@ -439,7 +439,7 @@ namespace vfs { public watchDirectory(path: string, watcher: (path: string) => void, recursive?: boolean) { if (!this._watchedDirectories) { const pathComparer = this.useCaseSensitiveFileNames ? vpath.compare.caseSensitive : vpath.compare.caseInsensitive; - this._watchedDirectories = new SortedCollection(pathComparer); + this._watchedDirectories = new KeyedCollection(pathComparer); } path = vpath.resolve(this.currentDirectory, path); @@ -641,7 +641,7 @@ namespace vfs { export class VirtualDirectory extends VirtualFileSystemEntry { protected _shadowRoot: VirtualDirectory | undefined; private _parent: VirtualDirectory; - private _entries: SortedCollection | undefined; + private _entries: KeyedCollection | undefined; private _resolver: FileSystemResolver | undefined; private _onChildFileSystemChange: (path: string, change: FileSystemChange) => void; @@ -907,7 +907,7 @@ namespace vfs { protected getOwnEntries() { if (!this._entries) { - const entries = new SortedCollection(this.fileSystem.stringComparer); + const entries = new KeyedCollection(this.fileSystem.stringComparer); const resolver = this._resolver; const shadowRoot = this._shadowRoot; if (resolver) { @@ -1053,8 +1053,8 @@ namespace vfs { export class VirtualDirectorySymlink extends VirtualDirectory { private _targetPath: string; private _target: VirtualDirectory | undefined; - private _views: SortedCollection | undefined; - private _allViews: SortedCollection | undefined; + private _views: KeyedCollection | undefined; + private _allViews: KeyedCollection | undefined; private _onTargetParentChildRemoved: (entry: VirtualEntry) => void; private _onTargetChildRemoved: (entry: VirtualEntry) => void; private _onTargetChildAdded: (entry: VirtualEntry) => void; @@ -1062,7 +1062,7 @@ namespace vfs { constructor(parent: VirtualDirectory, name: string, target: string) { super(parent, name); - this._views = new SortedCollection(this.fileSystem.stringComparer); + this._views = new KeyedCollection(this.fileSystem.stringComparer); this._targetPath = target; this._onTargetParentChildRemoved = entry => this.onTargetParentChildRemoved(entry); this._onTargetChildAdded = entry => this.onTargetChildAdded(entry); @@ -1142,9 +1142,9 @@ namespace vfs { return target && target.removeFile(name) || false; } - protected getOwnEntries(): SortedCollection { + protected getOwnEntries(): KeyedCollection { if (!this._allViews) { - this._allViews = new SortedCollection(this.fileSystem.stringComparer); + this._allViews = new KeyedCollection(this.fileSystem.stringComparer); const target = this.target; if (target) { for (const entry of target.getEntries()) { From 8a70e175b8c4d7e7c8e5c65a34e74c17920fdc17 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 7 Nov 2017 13:44:12 -0800 Subject: [PATCH 05/54] Cleanup after merge --- src/harness/collections.ts | 65 ++++--- src/harness/harness.ts | 256 +++++++++++++++----------- src/harness/harnessLanguageService.ts | 3 +- src/harness/loggedIO.ts | 10 +- src/harness/rwcRunner.ts | 2 +- src/harness/vfs.ts | 26 ++- src/harness/vpath.ts | 149 ++++++++++----- 7 files changed, 316 insertions(+), 195 deletions(-) diff --git a/src/harness/collections.ts b/src/harness/collections.ts index 8bdbb453c9835..d311216a9151e 100644 --- a/src/harness/collections.ts +++ b/src/harness/collections.ts @@ -5,36 +5,53 @@ namespace collections { // from depending directly on the compiler to speed up compilation time. import binarySearch = ts.binarySearch; - import removeAt = ts.orderedRemoveItemAt; - export function compareValues(a: T, b: T): number { + function compareValues(a: string | number, b: string | number): number { if (a === b) return 0; if (a === undefined) return -1; if (b === undefined) return +1; return a < b ? -1 : +1; } - const caseInsensitiveComparisonCollator = typeof Intl === "object" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "accent" }) : undefined; - const caseSensitiveComparisonCollator = typeof Intl === "object" ? new Intl.Collator(/*locales*/ undefined, { usage: "sort", sensitivity: "variant" }) : undefined; + export function compareNumbers(a: number, b: number): number { + return compareValues(a, b); + } + + export function compareStrings(a: string, b: string, ignoreCase: boolean): number { + return ignoreCase + ? compareStringsCaseInsensitive(a, b) + : compareStringsCaseSensitive(a, b); + } - export function compareStrings(a: string | undefined, b: string | undefined, ignoreCase: boolean) { + export function compareStringsCaseSensitive(a: string, b: string): number { + return compareValues(a, b); + } + + export function compareStringsCaseInsensitive(a: string, b: string): number { if (a === b) return 0; if (a === undefined) return -1; if (b === undefined) return +1; - const collator = ignoreCase ? caseInsensitiveComparisonCollator : caseSensitiveComparisonCollator; - if (collator) { - return collator.compare(a, b); - } - else if (ignoreCase) { - a = a.toUpperCase(); - b = b.toUpperCase(); - } + a = a.toUpperCase(); + b = b.toUpperCase(); return a < b ? -1 : a > b ? +1 : 0; } - export namespace compareStrings { - export function caseSensitive(a: string | undefined, b: string | undefined) { return compareStrings(a, b, /*ignoreCase*/ false); } - export function caseInsensitive(a: string | undefined, b: string | undefined) { return compareStrings(a, b, /*ignoreCase*/ true); } + export function equateStringsCaseSensitive(a: string, b: string): boolean { + return a === b; + } + + export function equateStringsCaseInsensitive(a: string, b: string): boolean { + return a === b + || a !== undefined + && b !== undefined + && a.toUpperCase() === b.toUpperCase(); + } + + function removeAt(array: T[], index: number): void { + for (let i = index; i < array.length - 1; i++) { + array[i] = array[i + 1]; + } + array.pop(); } function insertAt(array: T[], index: number, value: T) { @@ -63,7 +80,7 @@ namespace collections { private _version = 0; private _copyOnWrite = false; - constructor(comparer: (a: K, b: K) => number = compareValues) { + constructor(comparer: (a: K, b: K) => number) { this._comparer = comparer; } @@ -72,16 +89,16 @@ namespace collections { } public has(key: K) { - return binarySearch(this._keys, key, this._comparer) >= 0; + return binarySearch(this._keys, key, ts.identity, this._comparer) >= 0; } public get(key: K) { - const index = binarySearch(this._keys, key, this._comparer); + const index = binarySearch(this._keys, key, ts.identity, this._comparer); return index >= 0 ? this._values[index] : undefined; } public set(key: K, value: V) { - const index = binarySearch(this._keys, key, this._comparer); + const index = binarySearch(this._keys, key, ts.identity, this._comparer); if (index >= 0) { this._values[index] = value; } @@ -96,7 +113,7 @@ namespace collections { } public delete(key: K) { - const index = binarySearch(this._keys, key, this._comparer); + const index = binarySearch(this._keys, key, ts.identity, this._comparer); if (index >= 0) { this.writePreamble(); removeAt(this._keys, index); @@ -124,8 +141,8 @@ namespace collections { const order = this.getInsertionOrder(); const version = this._version; this._copyOnWrite = true; - for (let i = 0; i < order.length; i++) { - callback(values[order[i]], keys[order[i]], this); + for (const index of order) { + callback(values[index], keys[index], this); } if (version === this._version) { this._copyOnWrite = false; @@ -144,7 +161,7 @@ namespace collections { private getInsertionOrder() { return this._order .map((_, i) => i) - .sort((x, y) => compareValues(this._order[x], this._order[y])); + .sort((x, y) => compareNumbers(this._order[x], this._order[y])); } } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index b12939f3fa748..415de60fb6053 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -27,7 +27,7 @@ // Block scoped definitions work poorly for global variables, temporarily enable var -/* tslint:disable:no-var-keyword */ +/* tslint:disable:no-var-keyword prefer-const */ // this will work in the browser via browserify var _chai: typeof chai = require("chai"); @@ -53,7 +53,7 @@ interface XMLHttpRequest { getResponseHeader(header: string): string | null; overrideMimeType(mime: string): void; } -/* tslint:enable:no-var-keyword */ +/* tslint:enable:no-var-keyword prefer-const */ namespace Utils { // Setup some globals based on the current environment @@ -482,7 +482,8 @@ namespace Utils { } namespace Harness { - export interface Io { + // tslint:disable-next-line:interface-name + export interface IO { newLine(): string; getCurrentDirectory(): string; useCaseSensitiveFileNames(): boolean; @@ -512,7 +513,7 @@ namespace Harness { directories: string[]; } - export let IO: Io; + export let IO: IO; // harness always uses one kind of new line // But note that `parseTestData` in `fourslash.ts` uses "\n" @@ -521,7 +522,7 @@ namespace Harness { // Root for file paths that are stored in a virtual file system export const virtualFileSystemRoot = "/"; - function createNodeIO(): Io { + function createNodeIO(): IO { let fs: any, pathModule: any; if (require) { fs = require("fs"); @@ -535,8 +536,7 @@ namespace Harness { try { fs.unlinkSync(path); } - catch { /*ignore*/ } - } + catch { /*ignore*/ } } function directoryName(path: string) { @@ -570,7 +570,7 @@ namespace Harness { function getAccessibleFileSystemEntries(dirname: string): FileSystemEntries { try { - const entries: string[] = fs.readdirSync(dirname || ".").sort(ts.sys.useCaseSensitiveFileNames ? ts.compareStrings : ts.compareStringsCaseInsensitive); + const entries: string[] = fs.readdirSync(dirname || ".").sort(ts.sys.useCaseSensitiveFileNames ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive); const files: string[] = []; const directories: string[] = []; for (const entry of entries) { @@ -586,7 +586,7 @@ namespace Harness { directories.push(entry); } } - catch (e) { } + catch { /*ignore*/ } } return { files, directories }; } @@ -640,144 +640,188 @@ namespace Harness { new(url: string, base?: string | URL): URL; }; - function createBrowserIO(): Io { + function createBrowserIO(): IO { const serverRoot = new URL("http://localhost:8888/"); - interface HttpHeaders { - [key: string]: string | string[] | undefined; - } + class HttpHeaders extends Map { + constructor(template?: Record) { + super(); + if (template) { + for (const key in template) { + if (ts.hasProperty(template, key)) { + this.set(key, template[key]); + } + } + } + } - const HttpHeaders = { - combine(left: HttpHeaders | undefined, right: HttpHeaders | undefined): HttpHeaders { - return left && right ? { ...left, ...right } : - left ? { ...left } : - right ? { ...right } : - {}; - }, - writeRequestHeaders(xhr: XMLHttpRequest, headers: HttpHeaders) { - for (const key in headers) { - if (!headers.hasOwnProperty(key)) continue; - const keyLower = key.toLowerCase(); + public static combine(left: HttpHeaders | undefined, right: HttpHeaders | undefined): HttpHeaders { + if (!left && !right) return undefined; + const headers = new HttpHeaders(); + if (left) left.forEach((value, key) => { headers.set(key, value); }); + if (right) right.forEach((value, key) => { headers.set(key, value); }); + return headers; + } + + public has(key: string) { + return super.has(key.toLowerCase()); + } + + public get(key: string) { + return super.get(key.toLowerCase()); + } + + public set(key: string, value: string | string[]) { + return super.set(key.toLowerCase(), value); + } - if (keyLower === "access-control-allow-origin" || keyLower === "content-length") continue; - const values = headers[key]; + public delete(key: string) { + return super.delete(key.toLowerCase()); + } + + public writeRequestHeaders(xhr: XMLHttpRequest) { + this.forEach((values, key) => { + if (key === "access-control-allow-origin" || key === "content-length") return; const value = Array.isArray(values) ? values.join(",") : values; - if (keyLower === "content-type") { + if (key === "content-type") { xhr.overrideMimeType(value); - continue; + return; } - xhr.setRequestHeader(key, value); - } - }, - readResponseHeaders(xhr: XMLHttpRequest): HttpHeaders { + }); + } + + public static readResponseHeaders(xhr: XMLHttpRequest): HttpHeaders { const allHeaders = xhr.getAllResponseHeaders(); - const headers: HttpHeaders = {}; + const headers = new HttpHeaders(); for (const header of allHeaders.split(/\r\n/g)) { const colonIndex = header.indexOf(":"); if (colonIndex >= 0) { const key = header.slice(0, colonIndex).trim(); const value = header.slice(colonIndex + 1).trim(); const values = value.split(","); - headers[key] = values.length > 1 ? values : value; + headers.set(key, values.length > 1 ? values : value); } } return headers; } - }; - - interface HttpContent { - headers: HttpHeaders; - content: string; } - const HttpContent = { - create(headers: HttpHeaders, content: string): HttpContent { - return { headers, content }; - }, - fromMediaType(mediaType: string, content: string) { - return HttpContent.create({ "Content-Type": mediaType }, content); - }, - text(content: string) { + class HttpContent { + public headers: HttpHeaders; + public content: string; + + constructor(headers: HttpHeaders | Record, content: string) { + this.headers = headers instanceof HttpHeaders ? headers : new HttpHeaders(headers); + this.content = content; + } + + public static fromMediaType(mediaType: string, content: string) { + return new HttpContent({ "Content-Type": mediaType }, content); + } + + public static text(content: string) { return HttpContent.fromMediaType("text/plain", content); - }, - json(content: object) { + } + + public static json(content: object) { return HttpContent.fromMediaType("application/json", JSON.stringify(content)); - }, - readResponseContent(xhr: XMLHttpRequest) { + } + + public static readResponseContent(xhr: XMLHttpRequest) { if (typeof xhr.responseText === "string") { - return HttpContent.create({ + return new HttpContent({ "Content-Type": xhr.getResponseHeader("Content-Type") || undefined, "Content-Length": xhr.getResponseHeader("Content-Length") || undefined }, xhr.responseText); } return undefined; } - }; - interface HttpRequestMessage { - method: string; - url: URL; - headers: HttpHeaders; - content?: HttpContent; + public writeRequestHeaders(xhr: XMLHttpRequest) { + this.headers.writeRequestHeaders(xhr); + } } - const HttpRequestMessage = { - create(method: string, url: string | URL, headers: HttpHeaders = {}, content?: HttpContent): HttpRequestMessage { - if (typeof url === "string") url = new URL(url); - return { method, url, headers, content }; - }, - options(url: string | URL) { - return HttpRequestMessage.create("OPTIONS", url); - }, - head(url: string | URL) { - return HttpRequestMessage.create("HEAD", url); - }, - get(url: string | URL) { - return HttpRequestMessage.create("GET", url); - }, - delete(url: string | URL) { - return HttpRequestMessage.create("DELETE", url); - }, - put(url: string | URL, content: HttpContent) { - return HttpRequestMessage.create("PUT", url, {}, content); - }, - post(url: string | URL, content: HttpContent) { - return HttpRequestMessage.create("POST", url, {}, content); - }, - }; + class HttpRequestMessage { + public method: string; + public url: URL; + public headers: HttpHeaders; + public content?: HttpContent; + + constructor(method: string, url: string | URL, headers?: HttpHeaders | Record, content?: HttpContent) { + this.method = method; + this.url = typeof url === "string" ? new URL(url) : url; + this.headers = headers instanceof HttpHeaders ? headers : new HttpHeaders(headers); + this.content = content; + } + + public static options(url: string | URL) { + return new HttpRequestMessage("OPTIONS", url); + } - interface HttpResponseMessage { - statusCode: number; - statusMessage: string; - headers: HttpHeaders; - content?: HttpContent; + public static head(url: string | URL) { + return new HttpRequestMessage("HEAD", url); + } + + public static get(url: string | URL) { + return new HttpRequestMessage("GET", url); + } + + public static delete(url: string | URL) { + return new HttpRequestMessage("DELETE", url); + } + + public static put(url: string | URL, content: HttpContent) { + return new HttpRequestMessage("PUT", url, /*headers*/ undefined, content); + } + + public static post(url: string | URL, content: HttpContent) { + return new HttpRequestMessage("POST", url, /*headers*/ undefined, content); + } + + public writeRequestHeaders(xhr: XMLHttpRequest) { + this.headers.writeRequestHeaders(xhr); + if (this.content) { + this.content.writeRequestHeaders(xhr); + } + } } - const HttpResponseMessage = { - create(statusCode: number, statusMessage: string, headers: HttpHeaders = {}, content?: HttpContent): HttpResponseMessage { - return { statusCode, statusMessage, headers, content }; - }, - notFound(): HttpResponseMessage { - return HttpResponseMessage.create(404, "Not Found"); - }, - hasSuccessStatusCode(response: HttpResponseMessage) { + class HttpResponseMessage { + public statusCode: number; + public statusMessage: string; + public headers: HttpHeaders; + public content?: HttpContent; + + constructor(statusCode: number, statusMessage: string, headers?: HttpHeaders | Record, content?: HttpContent) { + this.statusCode = statusCode; + this.statusMessage = statusMessage; + this.headers = headers instanceof HttpHeaders ? headers : new HttpHeaders(headers); + this.content = content; + } + + public static notFound(): HttpResponseMessage { + return new HttpResponseMessage(404, "Not Found"); + } + + public static hasSuccessStatusCode(response: HttpResponseMessage) { return response.statusCode === 304 || (response.statusCode >= 200 && response.statusCode < 300); - }, - readResponseMessage(xhr: XMLHttpRequest) { - return HttpResponseMessage.create( + } + + public static readResponseMessage(xhr: XMLHttpRequest) { + return new HttpResponseMessage( xhr.status, xhr.statusText, HttpHeaders.readResponseHeaders(xhr), HttpContent.readResponseContent(xhr)); } - }; + } function send(request: HttpRequestMessage): HttpResponseMessage { const xhr = new XMLHttpRequest(); try { - HttpHeaders.writeRequestHeaders(xhr, request.headers); - HttpHeaders.writeRequestHeaders(xhr, request.content && request.content.headers); + request.writeRequestHeaders(xhr); xhr.setRequestHeader("Access-Control-Allow-Origin", "*"); xhr.open(request.method, request.url.toString(), /*async*/ false); xhr.send(request.content && request.content.content); @@ -794,7 +838,7 @@ namespace Harness { function useCaseSensitiveFileNames() { if (!caseSensitivity) { const response = send(HttpRequestMessage.options(new URL("*", serverRoot))); - const xCaseSensitivity = response.headers["X-Case-Sensitivity"]; + const xCaseSensitivity = response.headers.get("X-Case-Sensitivity"); caseSensitivity = xCaseSensitivity === "CS" ? "CS" : "CI"; } return caseSensitivity === "CS"; @@ -849,7 +893,7 @@ namespace Harness { const response = send(HttpRequestMessage.post(new URL("/api/listFiles", serverRoot), HttpContent.text(dirname))); return HttpResponseMessage.hasSuccessStatusCode(response) && response.content - && response.content.headers["Content-Type"] === "application/json" + && response.content.headers.get("Content-Type") === "application/json" ? JSON.parse(response.content.content) : []; } @@ -882,7 +926,7 @@ namespace Harness { writeFile, directoryName: Utils.memoize(directoryName, path => path), getDirectories: () => [], - createDirectory: () => {}, + createDirectory: () => {}, // tslint:disable-line no-empty fileExists, directoryExists, deleteFile, @@ -890,7 +934,7 @@ namespace Harness { log: s => console.log(s), args: () => [], getExecutingFilePath: () => "", - exit: () => {}, + exit: () => {}, // tslint:disable-line no-empty readDirectory, getAccessibleFileSystemEntries }; @@ -2284,7 +2328,7 @@ namespace Harness { return filePath.indexOf(Harness.libFolder) === 0; } - export function getDefaultLibraryFile(io: Harness.Io): Harness.Compiler.TestFile { + export function getDefaultLibraryFile(io: Harness.IO): Harness.Compiler.TestFile { const libFile = Harness.userSpecifiedRoot + Harness.libFolder + Harness.Compiler.defaultLibFileName; return { unitName: libFile, content: io.readFile(libFile) }; } diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 2e36a1412ab42..891c2c3dc4fe7 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -214,8 +214,7 @@ namespace Harness.LanguageService { } directoryExists(dirName: string): boolean { - const fileEntry = this.virtualFileSystem.traversePath(dirName); - return fileEntry && fileEntry.isDirectory(); + return this.virtualFileSystem.directoryExists(dirName); } fileExists(fileName: string): boolean { diff --git a/src/harness/loggedIO.ts b/src/harness/loggedIO.ts index 37e8dddb3d743..2c8ae6e2703e2 100644 --- a/src/harness/loggedIO.ts +++ b/src/harness/loggedIO.ts @@ -110,7 +110,7 @@ namespace Playback { return run; } - export interface PlaybackIO extends Harness.Io, PlaybackControl { } + export interface PlaybackIO extends Harness.IO, PlaybackControl { } export interface PlaybackSystem extends ts.System, PlaybackControl { } @@ -134,7 +134,7 @@ namespace Playback { }; } - export function newStyleLogIntoOldStyleLog(log: IoLog, host: ts.System | Harness.Io, baseName: string) { + export function newStyleLogIntoOldStyleLog(log: IoLog, host: ts.System | Harness.IO, baseName: string) { for (const file of log.filesAppended) { if (file.contentsPath) { file.contents = host.readFile(ts.combinePaths(baseName, file.contentsPath)); @@ -210,8 +210,8 @@ namespace Playback { } function initWrapper(wrapper: PlaybackSystem, underlying: ts.System): void; - function initWrapper(wrapper: PlaybackIO, underlying: Harness.Io): void; - function initWrapper(wrapper: PlaybackSystem | PlaybackIO, underlying: ts.System | Harness.Io): void { + function initWrapper(wrapper: PlaybackIO, underlying: Harness.IO): void; + function initWrapper(wrapper: PlaybackSystem | PlaybackIO, underlying: ts.System | Harness.IO): void { ts.forEach(Object.keys(underlying), prop => { (wrapper)[prop] = (underlying)[prop]; }); @@ -427,7 +427,7 @@ namespace Playback { // console.log("Swallowed write operation during replay: " + name); } - export function wrapIO(underlying: Harness.Io): PlaybackIO { + export function wrapIO(underlying: Harness.IO): PlaybackIO { const wrapper: PlaybackIO = {}; initWrapper(wrapper, underlying); diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index af6e8c95c5c6b..31985529f901e 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -6,7 +6,7 @@ /* tslint:disable:no-null-keyword */ namespace RWC { - function runWithIOLog(ioLog: IoLog, fn: (oldIO: Harness.Io) => void) { + function runWithIOLog(ioLog: IoLog, fn: (oldIO: Harness.IO) => void) { const oldIO = Harness.IO; const wrappedIO = Playback.wrapIO(oldIO); diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index dbdb685d1af0c..bb0c5f96b1208 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -4,7 +4,6 @@ /// /// namespace vfs { - import compareStrings = collections.compareStrings; import KeyedCollection = collections.KeyedCollection; import Metadata = collections.Metadata; import EventEmitter = events.EventEmitter; @@ -27,7 +26,7 @@ namespace vfs { if (!map) return identityMapper; const roots = Object.keys(map); const patterns = roots.map(root => createPattern(root, ignoreCase)); - return function (path: string) { + return (path: string) => { for (let i = 0; i < patterns.length; i++) { const match = patterns[i].exec(path); if (match) { @@ -136,14 +135,14 @@ namespace vfs { public get stringComparer() { return this.useCaseSensitiveFileNames - ? compareStrings.caseSensitive - : compareStrings.caseInsensitive; + ? collections.compareStringsCaseSensitive + : collections.compareStringsCaseInsensitive; } public get pathComparer() { return this.useCaseSensitiveFileNames - ? vpath.compare.caseSensitive - : vpath.compare.caseInsensitive; + ? vpath.compareCaseSensitive + : vpath.compareCaseInsensitive; } /** @@ -409,7 +408,7 @@ namespace vfs { */ public watchFile(path: string, watcher: (path: string, change: FileSystemChange) => void): ts.FileWatcher { if (!this._watchedFiles) { - const pathComparer = this.useCaseSensitiveFileNames ? vpath.compare.caseSensitive : vpath.compare.caseInsensitive; + const pathComparer = this.useCaseSensitiveFileNames ? vpath.compareCaseSensitive : vpath.compareCaseInsensitive; this._watchedFiles = new KeyedCollection(pathComparer); } @@ -438,7 +437,7 @@ namespace vfs { */ public watchDirectory(path: string, watcher: (path: string) => void, recursive?: boolean) { if (!this._watchedDirectories) { - const pathComparer = this.useCaseSensitiveFileNames ? vpath.compare.caseSensitive : vpath.compare.caseInsensitive; + const pathComparer = this.useCaseSensitiveFileNames ? vpath.compareCaseSensitive : vpath.compareCaseInsensitive; this._watchedDirectories = new KeyedCollection(pathComparer); } @@ -631,11 +630,9 @@ namespace vfs { export interface VirtualDirectory { on(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; - on(event: "childAdded", listener: (child: VirtualEntry) => void): this; - on(event: "childRemoved", listener: (child: VirtualEntry) => void): this; + on(event: "childAdded" | "childRemoved", listener: (child: VirtualEntry) => void): this; emit(event: "fileSystemChange", path: string, change: FileSystemChange): boolean; - emit(event: "childAdded", child: VirtualEntry): boolean; - emit(event: "childRemoved", child: VirtualEntry): boolean; + emit(event: "childAdded" | "childRemoved", child: VirtualEntry): boolean; } export class VirtualDirectory extends VirtualFileSystemEntry { @@ -1020,7 +1017,7 @@ namespace vfs { if (components[1] === "..") return undefined; // walk the components - let directory: VirtualDirectory | undefined = this; + let directory: VirtualDirectory | undefined = this; // tslint:disable-line:no-this-assignment for (let i = this.parent ? 1 : 0; i < components.length - 1; i++) { directory = create ? directory.getOrAddOwnDirectory(components[i]) : directory.getOwnDirectory(components[i]); if (directory === undefined) return undefined; @@ -1360,8 +1357,7 @@ namespace vfs { return shadow; } - protected makeReadOnlyCore(): void { - } + protected makeReadOnlyCore(): void { /*ignored*/ } } export class VirtualFileSymlink extends VirtualFile { diff --git a/src/harness/vpath.ts b/src/harness/vpath.ts index 44783ccd229f3..fe6a6b36a12e3 100644 --- a/src/harness/vpath.ts +++ b/src/harness/vpath.ts @@ -4,11 +4,17 @@ namespace vpath { // to reduce the number of direct dependencies on compiler and services to eventually break away // from depending directly on the compiler to speed up compilation time. - import compareValues = collections.compareValues; + import compareValues = collections.compareNumbers; import compareStrings = collections.compareStrings; + /** + * Virtual path separator. + */ export const sep = "/"; + /** + * Normalize path separators. + */ export function normalizeSeparators(path: string): string { return path.replace(/\s*[\\/]\s*/g, sep).trim(); } @@ -20,20 +26,33 @@ namespace vpath { return match ? match[0].length : 0; } + /** + * Determines whether a path is an absolute path (e.g. starts with `/`, `\\`, or a dos path + * like `c:`). + */ export function isAbsolute(path: string) { return rootRegExp.test(path); } const trailingSeperatorRegExp = /[\\/]$/; + /** + * Determines whether a path has a trailing separator (`/`). + */ export function hasTrailingSeparator(path: string) { return trailingSeperatorRegExp.test(path); } + /** + * Adds a trailing separator (`/`) to a path if it doesn't have one. + */ export function addTrailingSeparator(path: string) { return hasTrailingSeparator(path) ? path : path + "/"; } + /** + * Removes a trailing separator (`/`) from a path if it has one. + */ export function removeTrailingSeparator(path: string) { return hasTrailingSeparator(path) ? path.slice(0, -1) : path; } @@ -53,11 +72,17 @@ namespace vpath { return normalized; } + /** + * Normalize a path containing path traversal components (`.` or `..`). + */ export function normalize(path: string): string { const components = reduce(parse(path)); return components.length > 1 && hasTrailingSeparator(path) ? format(components) + sep : format(components); } + /** + * Combines two or more paths. If a path is absolute, it replaces any previous path. + */ export function combine(path: string, ...paths: string[]) { path = normalizeSeparators(path); for (let name of paths) { @@ -69,10 +94,16 @@ namespace vpath { return path; } + /** + * Combines and normalizes two or more paths. + */ export function resolve(path: string, ...paths: string[]) { return normalize(combine(path, ...paths)); } + /** + * Gets a relative path that can be used to traverse between `from` and `to`. + */ export function relative(from: string, to: string, ignoreCase: boolean) { if (!isAbsolute(from)) throw new Error("Path not absolute"); if (!isAbsolute(to)) throw new Error("Path not absolute"); @@ -99,11 +130,9 @@ namespace vpath { return format(["", ...components]); } - export namespace relative { - export function caseSensitive(from: string, to: string) { return relative(from, to, /*ignoreCase*/ false); } - export function caseInsensitive(from: string, to: string) { return relative(from, to, /*ignoreCase*/ true); } - } - + /** + * Compare two paths. + */ export function compare(a: string, b: string, ignoreCase: boolean) { if (!isAbsolute(a)) throw new Error("Path not absolute"); if (!isAbsolute(b)) throw new Error("Path not absolute"); @@ -121,41 +150,55 @@ namespace vpath { return compareValues(aComponents.length, bComponents.length); } - export namespace compare { - export function caseSensitive(a: string, b: string) { return compare(a, b, /*ignoreCase*/ false); } - export function caseInsensitive(a: string, b: string) { return compare(a, b, /*ignoreCase*/ true); } - } + /** + * Performs a case-sensitive comparison of two paths. + */ + export function compareCaseSensitive(a: string, b: string) { return compare(a, b, /*ignoreCase*/ false); } - export function equals(a: string, b: string, ignoreCase: boolean) { - return compare(a, b, ignoreCase) === 0; - } + /** + * Performs a case-insensitive comparison of two paths. + */ + export function compareCaseInsensitive(a: string, b: string) { return compare(a, b, /*ignoreCase*/ true); } - export namespace equals { - export function caseSensitive(a: string, b: string) { return equals(a, b, /*ignoreCase*/ false); } - export function caseInsensitive(a: string, b: string) { return equals(a, b, /*ignoreCase*/ true); } + /** + * Determines whether two strings are equal. + */ + export function equals(a: string, b: string, ignoreCase: boolean) { + if (!isAbsolute(a)) throw new Error("Path not absolute"); + if (!isAbsolute(b)) throw new Error("Path not absolute"); + if (a === b) return true; + a = removeTrailingSeparator(a); + b = removeTrailingSeparator(b); + if (a === b) return true; + a = normalize(a); + b = normalize(b); + if (a === b) return true; + return ignoreCase && a.toUpperCase() === b.toUpperCase(); } + /** + * Determines whether the path `descendant` is beneath the path `ancestor`. + */ export function beneath(ancestor: string, descendant: string, ignoreCase: boolean) { if (!isAbsolute(ancestor)) throw new Error("Path not absolute"); if (!isAbsolute(descendant)) throw new Error("Path not absolute"); - const ancestorComponents = reduce(parse(ancestor)); const descendantComponents = reduce(parse(descendant)); - const len = Math.min(ancestorComponents.length, descendantComponents.length); - let start: number; - for (start = 0; start < len; start++) { - if (compareStrings(ancestorComponents[start], descendantComponents[start], ignoreCase)) { - break; + if (descendantComponents.length < ancestorComponents.length) return false; + const equalityComparer = ignoreCase ? collections.equateStringsCaseInsensitive : collections.equateStringsCaseSensitive; + for (let i = 0; i < ancestorComponents.length; i++) { + if (!equalityComparer(ancestorComponents[i], descendantComponents[i])) { + return false; } } - return start === ancestorComponents.length; - } - - export namespace beneath { - export function caseSensitive(ancestor: string, descendant: string) { return beneath(ancestor, descendant, /*ignoreCase*/ false); } - export function caseInsensitive(ancestor: string, descendant: string) { return beneath(ancestor, descendant, /*ignoreCase*/ true); } + return true; } + /** + * Parse a path into a root component and zero or more path segments. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + */ export function parse(path: string) { path = normalizeSeparators(path); const rootLength = getRootLength(path); @@ -165,37 +208,59 @@ namespace vpath { return [root, ...rest.map(component => component.trim())]; } + /** + * Formats a parsed path consisting of a root component and zero or more path segments. + */ export function format(components: string[]) { return components.length ? components[0] + components.slice(1).join(sep) : ""; } + /** + * Gets the parent directory name of a path. + */ export function dirname(path: string) { path = normalizeSeparators(path); return path.substr(0, Math.max(getRootLength(path), path.lastIndexOf(sep))); } - export function basename(path: string, ext?: string): string; - export function basename(path: string, options?: { extensions?: string[], ignoreCase?: boolean }): string; - export function basename(path: string, options?: { extensions?: string[], ignoreCase?: boolean } | string) { + /** + * Gets the portion of a path following the last separator (`/`). + */ + export function basename(path: string): string; + /** + * Gets the portion of a path following the last separator (`/`). + * If the base name has any one of the provided extensions, it is removed. + */ + export function basename(path: string, extensions: string | string[], ignoreCase: boolean): string; + export function basename(path: string, extensions?: string | string[], ignoreCase?: boolean) { path = normalizeSeparators(path); const name = path.substr(Math.max(getRootLength(path), path.lastIndexOf(sep) + 1)); - const extension = typeof options === "string" ? options.startsWith(".") ? options : "." + options : - options && options.extensions ? extname(name, options) : - undefined; + const extension = extensions ? extname(path, extensions, ignoreCase) : undefined; return extension ? name.slice(0, name.length - extension.length) : name; } const extRegExp = /\.\w+$/; - export function extname(path: string, options?: { extensions?: string[], ignoreCase?: boolean }) { - if (options && options.extensions) { - for (let extension of options.extensions) { + /** + * Gets the file extension for a path. + */ + export function extname(path: string): string; + /** + * Gets the file extension for a path, provided it is one of the provided extensions. + */ + export function extname(path: string, extensions: string | string[], ignoreCase: boolean): string; + export function extname(path: string, extensions?: string | string[], ignoreCase?: boolean) { + if (extensions) { + const manyExtensions = Array.isArray(extensions) ? extensions : undefined; + const singleExtension = Array.isArray(extensions) ? undefined : extensions; + const length = manyExtensions ? manyExtensions.length : 1; + const comparer = ignoreCase ? collections.compareStringsCaseInsensitive : collections.compareStringsCaseSensitive; + for (let i = 0; i < length; i++) { + let extension = manyExtensions ? manyExtensions[i] : singleExtension; if (!extension.startsWith(".")) extension = "." + extension; - if (path.length > extension.length) { - const ext = path.slice(path.length - extension.length); - if (compareStrings(ext, extension, options.ignoreCase) === 0) { - return ext; - } + if (path.length >= extension.length && + comparer(path.slice(path.length - extension.length), extension) === 0) { + return extension; } } return ""; From 07bb677e8d2a9625bca153b2e09fa89846a75f53 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 7 Nov 2017 17:04:36 -0800 Subject: [PATCH 06/54] Cache comparers --- src/harness/vfs.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index bb0c5f96b1208..9dd7295db619a 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -124,6 +124,8 @@ namespace vfs { private _shadowRoot: VirtualFileSystem | undefined; private _watchedFiles: KeyedCollection | undefined; private _watchedDirectories: KeyedCollection | undefined; + private _stringComparer: ts.Comparer | undefined; + private _pathComparer: ts.Comparer | undefined; private _onRootFileSystemChange: (path: string, change: FileSystemChange) => void; constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean) { @@ -134,15 +136,15 @@ namespace vfs { } public get stringComparer() { - return this.useCaseSensitiveFileNames + return this._stringComparer || (this._stringComparer = this.useCaseSensitiveFileNames ? collections.compareStringsCaseSensitive - : collections.compareStringsCaseInsensitive; + : collections.compareStringsCaseInsensitive); } public get pathComparer() { - return this.useCaseSensitiveFileNames + return this._pathComparer || (this._pathComparer = this.useCaseSensitiveFileNames ? vpath.compareCaseSensitive - : vpath.compareCaseInsensitive; + : vpath.compareCaseInsensitive); } /** From 8245f6246dbc71188771ff5ed58ef8cab79bce05 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 9 Nov 2017 16:01:33 -0800 Subject: [PATCH 07/54] Update Harness.compileFiles to use vfs --- Jakefile.js | 83 +- src/compiler/core.ts | 2 +- src/compiler/emitter.ts | 3 +- src/harness/compiler.ts | 377 +++++++++ src/harness/compilerRunner.ts | 12 +- src/harness/documents.ts | 169 ++++ src/harness/events.ts | 10 +- src/harness/harness.ts | 101 +-- src/harness/runner.ts | 4 - src/harness/tsconfig.json | 15 +- src/harness/utils.ts | 51 ++ src/harness/vfs.ts | 141 +++- src/harness/vpath.ts | 36 +- .../baselines/reference/ES5For-of1.errors.txt | 9 - tests/baselines/reference/ES5For-of1.symbols | 3 + tests/baselines/reference/ES5For-of1.types | 8 +- .../reference/ES5For-of22.errors.txt | 10 - tests/baselines/reference/ES5For-of22.symbols | 3 + tests/baselines/reference/ES5For-of22.types | 8 +- .../reference/ES5For-of23.errors.txt | 10 - tests/baselines/reference/ES5For-of23.symbols | 3 + tests/baselines/reference/ES5For-of23.types | 8 +- .../reference/ES5For-of33.errors.txt | 9 - tests/baselines/reference/ES5For-of33.symbols | 3 + tests/baselines/reference/ES5For-of33.types | 8 +- .../anyAssignabilityInInheritance.symbols | 4 +- .../anyAssignableToEveryType.symbols | 4 +- .../anyAssignableToEveryType2.symbols | 2 +- .../argumentsObjectIterator01_ES6.symbols | 4 +- .../argumentsObjectIterator02_ES6.symbols | 10 +- .../reference/arrayLiterals2ES6.symbols | 10 +- .../arrowFunctionContexts.errors.txt | 14 +- .../reference/arrowFunctionContexts.symbols | 10 + .../reference/arrowFunctionContexts.types | 20 +- ...rrowFunctionWithObjectLiteralBody6.symbols | 6 +- tests/baselines/reference/asOperator1.symbols | 2 +- ...ssignmentCompatWithCallSignatures3.symbols | 4 +- ...mentCompatWithConstructSignatures3.symbols | 4 +- .../asyncAliasReturnType_es6.symbols | 2 +- .../asyncArrowFunction10_es6.symbols | 2 +- .../reference/asyncArrowFunction1_es6.symbols | 2 +- .../asyncArrowFunction5_es6.errors.txt | 4 +- .../reference/asyncArrowFunction5_es6.symbols | 2 +- .../reference/asyncArrowFunction6_es6.symbols | 2 +- .../reference/asyncArrowFunction7_es6.symbols | 4 +- .../reference/asyncArrowFunction8_es6.symbols | 2 +- .../asyncArrowFunction9_es6.errors.txt | 4 +- .../reference/asyncArrowFunction9_es6.symbols | 2 +- ...ArrowFunctionCapturesArguments_es6.symbols | 4 +- .../asyncAwaitIsolatedModules_es6.symbols | 16 +- .../reference/asyncAwait_es6.symbols | 20 +- .../reference/asyncDeclare_es6.symbols | 2 +- .../asyncFunctionDeclaration10_es6.symbols | 2 +- .../asyncFunctionDeclaration11_es6.symbols | 2 +- .../asyncFunctionDeclaration12_es6.symbols | 2 +- .../asyncFunctionDeclaration13_es6.symbols | 2 +- .../asyncFunctionDeclaration14_es6.symbols | 2 +- .../asyncFunctionDeclaration15_es6.symbols | 2 +- .../asyncFunctionDeclaration1_es6.symbols | 2 +- .../asyncFunctionDeclaration5_es6.symbols | 2 +- .../asyncFunctionDeclaration6_es6.symbols | 2 +- .../asyncFunctionDeclaration7_es6.symbols | 4 +- .../asyncFunctionDeclaration9_es6.symbols | 2 +- .../asyncFunctionNoReturnType.errors.txt | 5 +- .../asyncFunctionNoReturnType.symbols | 11 +- .../reference/asyncFunctionNoReturnType.types | 2 +- .../reference/asyncFunctionReturnType.symbols | 92 +-- .../asyncFunctionsAndStrictNullChecks.symbols | 2 +- tests/baselines/reference/asyncIIFE.symbols | 2 +- .../asyncImportedPromise_es6.symbols | 2 +- .../asyncQualifiedReturnType_es6.symbols | 2 +- ...ncUnParenthesizedArrowFunction_es6.symbols | 2 +- .../reference/asyncUseStrict_es6.symbols | 4 +- .../awaitBinaryExpression1_es6.symbols | 4 +- .../awaitBinaryExpression2_es6.symbols | 4 +- .../awaitBinaryExpression3_es6.symbols | 4 +- .../awaitBinaryExpression4_es6.symbols | 4 +- .../awaitBinaryExpression5_es6.symbols | 4 +- .../awaitCallExpression1_es6.symbols | 8 +- .../awaitCallExpression2_es6.symbols | 8 +- .../awaitCallExpression3_es6.symbols | 8 +- .../awaitCallExpression4_es6.symbols | 8 +- .../awaitCallExpression5_es6.symbols | 8 +- .../awaitCallExpression6_es6.symbols | 8 +- .../awaitCallExpression7_es6.symbols | 8 +- .../awaitCallExpression8_es6.symbols | 8 +- .../awaitClassExpression_es6.symbols | 4 +- .../reference/awaitUnion_es6.symbols | 10 +- .../bindingPatternInParameter01.errors.txt | 12 - .../bindingPatternInParameter01.symbols | 3 + .../bindingPatternInParameter01.types | 8 +- .../binopAssignmentShouldHaveType.symbols | 4 +- ...gnatureAssignabilityInInheritance2.symbols | 4 +- .../reference/callWithSpreadES6.symbols | 2 +- .../capturedLetConstInLoop2_ES6.symbols | 80 +- .../capturedLetConstInLoop9_ES6.symbols | 16 +- .../reference/chainedAssignment2.symbols | 2 +- ...assExpressionWithStaticProperties3.symbols | 8 +- .../classExtendingBuiltinType.symbols | 2 +- .../classWithoutExplicitConstructor.symbols | 2 +- ...peratorWithSecondOperandObjectType.symbols | 4 +- ...peratorWithSecondOperandStringType.symbols | 4 +- .../computedPropertyNames3_ES6.symbols | 2 +- ...edPropertyNamesContextualType1_ES6.symbols | 8 +- ...edPropertyNamesContextualType2_ES6.symbols | 8 +- ...edPropertyNamesContextualType3_ES6.symbols | 8 +- ...ionalOperatorConditionIsObjectType.symbols | 6 +- .../constDeclarations-access2.symbols | 4 +- .../constDeclarations-access3.symbols | 4 +- .../constDeclarations-access4.symbols | 4 +- .../constDeclarations-access5.symbols | 4 +- ...gnatureAssignabilityInInheritance2.symbols | 4 +- ...torImplementationWithDefaultValues.symbols | 2 +- ...orImplementationWithDefaultValues2.symbols | 4 +- ...torWithIncompleteTypeAnnotation.errors.txt | 8 +- ...ructorWithIncompleteTypeAnnotation.symbols | 6 + ...structorWithIncompleteTypeAnnotation.types | 16 +- .../contextualTypingOfArrayLiterals1.symbols | 4 +- ...ngOfGenericFunctionTypedArguments1.symbols | 2 +- ...ontextualTypingOfTooShortOverloads.symbols | 4 +- .../reference/controlFlowInstanceof.symbols | 38 +- .../reference/controlFlowLoopAnalysis.js | 2 +- .../copyrightWithNewLine1.errors.txt | 5 +- .../reference/copyrightWithNewLine1.symbols | 3 + .../reference/copyrightWithNewLine1.types | 12 +- .../copyrightWithoutNewLine1.errors.txt | 5 +- .../copyrightWithoutNewLine1.symbols | 3 + .../reference/copyrightWithoutNewLine1.types | 12 +- .../reference/covariantCallbacks.symbols | 4 +- .../reference/customEventDetail.errors.txt | 11 - .../reference/customEventDetail.symbols | 5 + .../reference/customEventDetail.types | 14 +- .../declFileTypeAnnotationTypeAlias.symbols | 4 +- ...AnnotationVisibilityErrorTypeAlias.symbols | 6 +- .../reference/declarationEmitPromise.symbols | 18 +- .../reference/declarationFiles.symbols | 4 +- ...oratedDefaultExportsGetExportedAmd.symbols | 4 +- ...dDefaultExportsGetExportedCommonjs.symbols | 4 +- ...tedDefaultExportsGetExportedSystem.symbols | 4 +- ...oratedDefaultExportsGetExportedUmd.symbols | 4 +- .../decoratorMetadataPromise.symbols | 8 +- .../decoratorOnClassAccessor1.es6.symbols | 4 +- .../decoratorOnClassMethod1.es6.symbols | 4 +- .../decoratorOnClassMethod13.symbols | 4 +- .../reference/decoratorOnClassMethod4.symbols | 4 +- .../reference/decoratorOnClassMethod5.symbols | 4 +- .../reference/decoratorOnClassMethod6.symbols | 4 +- .../reference/decoratorOnClassMethod7.symbols | 4 +- ...coratorOnClassMethodParameter1.es6.symbols | 2 +- .../decoratorWithUnderscoreMethod.symbols | 4 +- .../decoratorsOnComputedProperties.symbols | 242 +++--- .../deduplicateImportsInSystem.errors.txt | 7 +- .../deduplicateImportsInSystem.symbols | 3 + .../deduplicateImportsInSystem.types | 8 +- .../defaultExportInAwaitExpression01.symbols | 2 +- .../defaultExportInAwaitExpression02.symbols | 2 +- ...rivedClassIncludesInheritedMembers.symbols | 2 +- ...vedClassWithoutExplicitConstructor.symbols | 4 +- ...edClassWithoutExplicitConstructor2.symbols | 14 +- ...edClassWithoutExplicitConstructor3.symbols | 8 +- ...tructuringParameterDeclaration3ES5.symbols | 20 +- ...tructuringParameterDeclaration3ES6.symbols | 20 +- ...owFunctionWhenUsingArguments14_ES6.symbols | 6 +- ...owFunctionWhenUsingArguments15_ES6.symbols | 6 +- ...owFunctionWhenUsingArguments16_ES6.symbols | 6 +- ...owFunctionWhenUsingArguments17_ES6.symbols | 6 +- ...owFunctionWhenUsingArguments18_ES6.symbols | 6 +- .../reference/enumAssignability.symbols | 4 +- .../enumAssignabilityInInheritance.symbols | 4 +- ...umConflictsWithGlobalIdentifier.errors.txt | 8 +- .../enumConflictsWithGlobalIdentifier.symbols | 4 +- .../enumConflictsWithGlobalIdentifier.types | 8 +- .../baselines/reference/enumErrors.errors.txt | 4 +- tests/baselines/reference/enumErrors.symbols | 6 +- tests/baselines/reference/enumErrors.types | 4 +- ...umIsNotASubtypeOfAnythingButNumber.symbols | 2 +- .../reference/es6ClassTest2.errors.txt | 5 +- .../baselines/reference/es6ClassTest2.symbols | 3 + tests/baselines/reference/es6ClassTest2.types | 8 +- .../everyTypeAssignableToAny.symbols | 4 +- ...ryTypeWithAnnotationAndInitializer.symbols | 4 +- ...ithAnnotationAndInvalidInitializer.symbols | 2 +- .../everyTypeWithInitializer.symbols | 2 +- ...essPropertyCheckWithEmptyObject.errors.txt | 5 +- ...excessPropertyCheckWithEmptyObject.symbols | 1 + .../excessPropertyCheckWithEmptyObject.types | 2 +- .../exportAssignNonIdentifier.symbols | 2 +- .../exportAssignValueAndType.symbols | 4 +- ...exportAssignedTypeAsTypeAnnotation.symbols | 2 +- .../exportDefaultAsyncFunction.symbols | 2 +- .../exportDefaultAsyncFunction2.symbols | 6 +- .../reference/exportEqualErrorType.symbols | 2 +- .../exportEqualMemberMissing.symbols | 2 +- .../reference/exportEqualNamespaces.symbols | 4 +- .../expressionTypeNodeShouldError.errors.txt | 15 +- .../expressionTypeNodeShouldError.symbols | 15 + .../expressionTypeNodeShouldError.types | 60 +- .../reference/fixSignatureCaching.errors.txt | 29 +- .../reference/fixSignatureCaching.symbols | 31 + .../reference/fixSignatureCaching.types | 60 +- .../reference/for-inStatements.symbols | 2 +- .../reference/for-inStatementsArray.symbols | 2 +- .../for-inStatementsArrayErrors.symbols | 2 +- tests/baselines/reference/for-of12.symbols | 4 +- tests/baselines/reference/for-of13.symbols | 4 +- tests/baselines/reference/for-of15.symbols | 6 +- tests/baselines/reference/for-of16.symbols | 6 +- tests/baselines/reference/for-of17.symbols | 6 +- tests/baselines/reference/for-of18.symbols | 6 +- tests/baselines/reference/for-of19.symbols | 6 +- tests/baselines/reference/for-of20.symbols | 6 +- tests/baselines/reference/for-of21.symbols | 6 +- tests/baselines/reference/for-of22.symbols | 6 +- tests/baselines/reference/for-of23.symbols | 6 +- tests/baselines/reference/for-of25.symbols | 6 +- tests/baselines/reference/for-of26.symbols | 6 +- tests/baselines/reference/for-of27.symbols | 6 +- tests/baselines/reference/for-of28.symbols | 6 +- tests/baselines/reference/for-of29.symbols | 8 +- tests/baselines/reference/for-of30.symbols | 6 +- tests/baselines/reference/for-of31.symbols | 6 +- tests/baselines/reference/for-of33.symbols | 6 +- tests/baselines/reference/for-of34.symbols | 6 +- tests/baselines/reference/for-of35.symbols | 6 +- tests/baselines/reference/for-of37.symbols | 2 +- tests/baselines/reference/for-of38.symbols | 2 +- tests/baselines/reference/for-of40.symbols | 2 +- tests/baselines/reference/for-of44.symbols | 2 +- tests/baselines/reference/for-of45.symbols | 2 +- tests/baselines/reference/for-of46.symbols | 2 +- tests/baselines/reference/for-of49.symbols | 2 +- tests/baselines/reference/for-of50.symbols | 2 +- tests/baselines/reference/for-of57.symbols | 2 +- .../baselines/reference/forStatements.symbols | 4 +- .../reference/functionCalls.errors.txt | 5 +- .../baselines/reference/functionCalls.symbols | 1 + tests/baselines/reference/functionCalls.types | 2 +- .../functionConstraintSatisfaction.symbols | 2 +- .../functionOverloadErrors.errors.txt | 11 +- .../reference/functionOverloadErrors.symbols | 5 +- .../reference/functionOverloadErrors.types | 18 +- .../functionOverloadsOnGenericArity2.symbols | 2 +- ...ionTypeArgumentAssignmentCompat.errors.txt | 5 +- ...nctionTypeArgumentAssignmentCompat.symbols | 3 + ...functionTypeArgumentAssignmentCompat.types | 8 +- ...faultParameterWithNoStatements9.errors.txt | 13 - ...hDefaultParameterWithNoStatements9.symbols | 6 + ...ithDefaultParameterWithNoStatements9.types | 20 +- .../reference/generatorES6_6.symbols | 6 +- .../reference/generatorOverloads1.symbols | 6 +- .../reference/generatorOverloads2.symbols | 6 +- .../reference/generatorOverloads3.symbols | 6 +- .../reference/generatorOverloads4.symbols | 6 +- .../reference/generatorOverloads5.symbols | 6 +- .../reference/generatorTypeCheck1.symbols | 2 +- .../reference/generatorTypeCheck10.symbols | 2 +- .../reference/generatorTypeCheck11.symbols | 2 +- .../reference/generatorTypeCheck12.symbols | 2 +- .../reference/generatorTypeCheck13.symbols | 2 +- .../reference/generatorTypeCheck17.symbols | 2 +- .../reference/generatorTypeCheck18.symbols | 2 +- .../reference/generatorTypeCheck19.symbols | 2 +- .../reference/generatorTypeCheck2.symbols | 2 +- .../reference/generatorTypeCheck20.symbols | 2 +- .../reference/generatorTypeCheck21.symbols | 2 +- .../reference/generatorTypeCheck25.symbols | 2 +- .../reference/generatorTypeCheck26.symbols | 10 +- .../reference/generatorTypeCheck27.symbols | 2 +- .../reference/generatorTypeCheck28.symbols | 12 +- .../reference/generatorTypeCheck29.symbols | 4 +- .../reference/generatorTypeCheck3.symbols | 2 +- .../reference/generatorTypeCheck30.symbols | 4 +- .../reference/generatorTypeCheck31.symbols | 4 +- .../reference/generatorTypeCheck45.symbols | 6 +- .../reference/generatorTypeCheck46.symbols | 12 +- .../reference/generatorTypeCheck62.symbols | 6 +- .../reference/generatorTypeCheck63.symbols | 6 +- .../reference/generatorTypeCheck7.symbols | 2 +- .../reference/generatorTypeCheck8.symbols | 4 +- ...hConstraintsTypeArgumentInference2.symbols | 10 +- ...cCallWithGenericSignatureArguments.symbols | 8 +- ...CallWithGenericSignatureArguments2.symbols | 14 +- ...cCallWithObjectTypeArgsAndIndexers.symbols | 4 +- ...ithObjectTypeArgsAndIndexersErrors.symbols | 2 +- ...ithObjectTypeArgsAndNumericIndexer.symbols | 8 +- ...WithObjectTypeArgsAndStringIndexer.symbols | 12 +- .../reference/genericCombinators2.symbols | 4 +- .../genericConstructorFunction1.symbols | 4 +- ...CallSignatureReturnTypeMismatch.errors.txt | 5 +- ...ionCallSignatureReturnTypeMismatch.symbols | 3 + ...ctionCallSignatureReturnTypeMismatch.types | 8 +- ...icFunctionsWithOptionalParameters3.symbols | 6 +- .../genericMethodOverspecialization.symbols | 12 +- .../genericPrototypeProperty2.symbols | 6 +- .../genericSignatureIdentity.symbols | 2 +- .../reference/genericTypeAssertions6.symbols | 26 +- .../reference/importCallExpression4ESNext.js | 1 - .../importCallExpression4ESNext.symbols | 41 +- .../importCallExpression4ESNext.types | 27 +- ...portCallExpressionCheckReturntype1.symbols | 6 +- .../importCallExpressionES6AMD.symbols | 4 +- .../importCallExpressionES6CJS.symbols | 4 +- .../importCallExpressionES6System.symbols | 4 +- .../importCallExpressionES6UMD.symbols | 4 +- ...ExpressionNoModuleKindSpecified.errors.txt | 9 +- ...portCallExpressionNoModuleKindSpecified.js | 1 - ...allExpressionNoModuleKindSpecified.symbols | 41 +- ...tCallExpressionNoModuleKindSpecified.types | 27 +- ...rtCallExpressionReturnPromiseOfAny.symbols | 12 +- ...ortCallExpressionShouldNotGetParen.symbols | 8 +- ...ressionSpecifierNotStringTypeError.symbols | 4 +- ...portCallExpressionWithTypeArgument.symbols | 2 +- .../reference/importHelpersES6.symbols | 16 +- .../reference/incompatibleExports1.symbols | 2 +- .../reference/incompatibleExports2.symbols | 2 +- ...incompleteDottedExpressionAtEOF.errors.txt | 5 +- .../incompleteDottedExpressionAtEOF.symbols | 1 + .../incompleteDottedExpressionAtEOF.types | 2 +- .../incrementAndDecrement.errors.txt | 29 +- .../reference/incrementAndDecrement.symbols | 1 + .../reference/incrementAndDecrement.types | 20 +- tests/baselines/reference/indexer3.symbols | 4 +- .../reference/indexersInClassType.symbols | 4 +- .../reference/inferenceLimit.symbols | 28 +- .../infinitelyExpandingTypes2.errors.txt | 22 - .../infinitelyExpandingTypes2.symbols | 3 + .../reference/infinitelyExpandingTypes2.types | 8 +- .../infinitelyExpandingTypes5.symbols | 8 +- ...ritanceOfGenericConstructorMethod1.symbols | 8 +- .../inheritedGenericCallSignature.symbols | 2 +- .../reference/inlineSourceMap.errors.txt | 8 - .../reference/inlineSourceMap.symbols | 3 + .../baselines/reference/inlineSourceMap.types | 8 +- .../reference/inlineSourceMap2.errors.txt | 7 +- .../reference/inlineSourceMap2.symbols | 3 + .../reference/inlineSourceMap2.types | 8 +- .../reference/inlineSources.errors.txt | 15 - .../baselines/reference/inlineSources.symbols | 6 + tests/baselines/reference/inlineSources.types | 16 +- .../reference/inlineSources2.errors.txt | 15 - .../reference/inlineSources2.symbols | 6 + .../baselines/reference/inlineSources2.types | 16 +- ...nnerTypeParameterShadowingOuterOne.symbols | 6 +- ...nerTypeParameterShadowingOuterOne2.symbols | 6 +- .../intersectionTypeInference3.symbols | 28 +- .../intersectionTypeInference3.types | 8 +- .../reference/invalidReturnStatements.symbols | 2 +- .../reference/iterableArrayPattern1.symbols | 8 +- .../reference/iterableArrayPattern10.symbols | 6 +- .../reference/iterableArrayPattern11.symbols | 6 +- .../reference/iterableArrayPattern12.symbols | 6 +- .../reference/iterableArrayPattern13.symbols | 6 +- .../reference/iterableArrayPattern14.symbols | 6 +- .../reference/iterableArrayPattern15.symbols | 6 +- .../reference/iterableArrayPattern16.symbols | 12 +- .../reference/iterableArrayPattern17.symbols | 6 +- .../reference/iterableArrayPattern18.symbols | 6 +- .../reference/iterableArrayPattern19.symbols | 6 +- .../reference/iterableArrayPattern2.symbols | 8 +- .../reference/iterableArrayPattern20.symbols | 6 +- .../reference/iterableArrayPattern25.symbols | 2 +- .../reference/iterableArrayPattern26.symbols | 2 +- .../reference/iterableArrayPattern27.symbols | 2 +- .../reference/iterableArrayPattern29.symbols | 2 +- .../reference/iterableArrayPattern3.symbols | 6 +- .../reference/iterableArrayPattern30.symbols | 2 +- .../reference/iterableArrayPattern4.symbols | 6 +- .../reference/iterableArrayPattern5.symbols | 6 +- .../reference/iterableArrayPattern6.symbols | 6 +- .../reference/iterableArrayPattern7.symbols | 6 +- .../reference/iterableArrayPattern8.symbols | 6 +- .../reference/iterableArrayPattern9.symbols | 6 +- .../iterableContextualTyping1.symbols | 6 +- .../reference/iteratorSpreadInArray.symbols | 8 +- .../reference/iteratorSpreadInArray10.symbols | 6 +- .../reference/iteratorSpreadInArray11.symbols | 2 +- .../reference/iteratorSpreadInArray2.symbols | 14 +- .../reference/iteratorSpreadInArray3.symbols | 8 +- .../reference/iteratorSpreadInArray4.symbols | 8 +- .../reference/iteratorSpreadInArray5.symbols | 8 +- .../reference/iteratorSpreadInArray6.symbols | 12 +- .../reference/iteratorSpreadInArray7.symbols | 12 +- .../reference/iteratorSpreadInArray8.symbols | 2 +- .../reference/iteratorSpreadInArray9.symbols | 8 +- .../reference/iteratorSpreadInCall.symbols | 8 +- .../reference/iteratorSpreadInCall10.symbols | 8 +- .../reference/iteratorSpreadInCall11.symbols | 8 +- .../reference/iteratorSpreadInCall12.symbols | 14 +- .../reference/iteratorSpreadInCall2.symbols | 8 +- .../reference/iteratorSpreadInCall3.symbols | 8 +- .../reference/iteratorSpreadInCall4.symbols | 8 +- .../reference/iteratorSpreadInCall5.symbols | 14 +- .../reference/iteratorSpreadInCall6.symbols | 14 +- .../reference/iteratorSpreadInCall7.symbols | 14 +- .../reference/iteratorSpreadInCall8.symbols | 14 +- .../reference/iteratorSpreadInCall9.symbols | 14 +- .../iteratorsAndStrictNullChecks.symbols | 8 +- .../reference/jsxEmitWithAttributes.symbols | 8 +- .../jsxFactoryAndReactNamespace.symbols | 8 +- .../reference/jsxFactoryIdentifier.symbols | 8 +- ...actoryNotIdentifierOrQualifiedName.symbols | 8 +- ...ctoryNotIdentifierOrQualifiedName2.symbols | 8 +- .../reference/jsxFactoryQualifiedName.symbols | 8 +- .../reference/lambdaArgCrash.symbols | 4 +- .../letConstInCaseClauses.errors.txt | 8 +- .../reference/letConstInCaseClauses.symbols | 6 + .../reference/letConstInCaseClauses.types | 16 +- .../reference/letDeclarations-access.symbols | 4 +- .../letShadowedByNameInNestedScope.errors.txt | 14 - .../letShadowedByNameInNestedScope.symbols | 3 + .../letShadowedByNameInNestedScope.types | 8 +- tests/baselines/reference/libdtsFix.symbols | 2 +- .../reference/library-reference-2.trace.json | 2 +- .../library_DatePrototypeProperties.symbols | 88 +- .../reference/localClassesInLoop_ES6.symbols | 4 +- tests/baselines/reference/localTypes5.symbols | 2 +- .../reference/mappedTypeErrors.symbols | 4 +- .../baselines/reference/mappedTypes1.symbols | 2 +- .../mergedInterfaceFromMultipleFiles1.symbols | 4 +- ...mergedInterfacesWithMultipleBases3.symbols | 2 +- .../reference/mixinClassesAnonymous.symbols | 2 +- .../multiExtendsSplitInterfaces1.errors.txt | 7 - .../multiExtendsSplitInterfaces1.symbols | 5 +- .../multiExtendsSplitInterfaces1.types | 8 +- .../narrowFromAnyWithInstanceof.symbols | 2 +- .../narrowFromAnyWithTypePredicate.symbols | 2 +- .../newNamesInGlobalAugmentations1.symbols | 4 +- tests/baselines/reference/newOperator.symbols | 8 +- ...nThisExpressionAndLocalVarInLambda.symbols | 6 +- ...ionThisExpressionAndLocalVarInLambda.types | 6 +- .../noImplicitReturnsInAsync1.symbols | 6 +- .../noImplicitReturnsInAsync2.symbols | 4 +- .../nullAssignableToEveryType.symbols | 4 +- ...lIsSubtypeOfEverythingButUndefined.symbols | 4 +- .../numericIndexerConstraint5.symbols | 2 +- .../reference/numericIndexerTyping1.symbols | 2 +- .../reference/numericIndexerTyping2.symbols | 2 +- ...iteralsWithTrailingDecimalPoints01.symbols | 36 +- .../objectLiteralGettersAndSetters.symbols | 4 +- .../reference/objectRestForOf.symbols | 4 +- ...tTypeHidingMembersOfExtendedObject.symbols | 4 +- ...thStringIndexerHidingObjectIndexer.symbols | 4 +- ...TypeWithStringNamedNumericProperty.symbols | 16 +- .../reference/objectTypesIdentity2.symbols | 2 +- ...ctTypesIdentityWithCallSignatures2.symbols | 2 +- ...esIdentityWithConstructSignatures2.symbols | 2 +- ...llSignaturesDifferingByConstraints.symbols | 2 +- ...lSignaturesDifferingByConstraints2.symbols | 2 +- ...allSignaturesDifferingByReturnType.symbols | 2 +- ...llSignaturesDifferingByReturnType2.symbols | 58 +- ...aturesDifferingTypeParameterCounts.symbols | 14 +- ...turesDifferingTypeParameterCounts2.symbols | 6 +- ...uctSignaturesDifferingByReturnType.symbols | 2 +- ...ctSignaturesDifferingByReturnType2.symbols | 50 +- ...aturesDifferingTypeParameterCounts.symbols | 12 +- .../reference/overloadOnGenericArity.symbols | 2 +- .../reference/overloadResolution.symbols | 8 +- ...verloadResolutionClassConstructors.symbols | 6 +- .../overloadResolutionConstructors.symbols | 8 +- .../parenthesizedContexualTyping3.symbols | 6 +- .../reference/parserArgumentList1.errors.txt | 5 +- .../reference/parserArgumentList1.symbols | 7 + .../reference/parserArgumentList1.types | 30 +- .../parserConstructorAmbiguity1.symbols | 2 +- .../parserConstructorAmbiguity2.symbols | 2 +- .../parserConstructorAmbiguity3.symbols | 2 +- .../parserConstructorAmbiguity4.symbols | 2 +- .../reference/parserInExpression1.errors.txt | 7 - .../reference/parserInExpression1.symbols | 5 +- .../reference/parserInExpression1.types | 8 +- ...IOnCallAfterFunctionExpression1.errors.txt | 5 +- ...oASIOnCallAfterFunctionExpression1.symbols | 1 + ...rNoASIOnCallAfterFunctionExpression1.types | 2 +- .../reference/parserNotHexLiteral1.errors.txt | 15 - .../reference/parserNotHexLiteral1.symbols | 6 + .../reference/parserNotHexLiteral1.types | 16 +- .../parserOverloadOnConstants1.errors.txt | 21 - .../parserOverloadOnConstants1.symbols | 14 +- .../parserOverloadOnConstants1.types | 16 +- .../reference/parserRealSource1.symbols | 4 +- .../reference/parserRealSource5.symbols | 4 +- .../reference/parserSymbolProperty1.symbols | 6 +- .../reference/parserSymbolProperty2.symbols | 6 +- .../reference/parserSymbolProperty3.symbols | 6 +- .../reference/parserSymbolProperty4.symbols | 6 +- .../reference/parserSymbolProperty5.symbols | 6 +- .../reference/parserSymbolProperty6.symbols | 6 +- .../reference/parserSymbolProperty7.symbols | 6 +- .../reference/parserSymbolProperty8.symbols | 6 +- .../reference/parserSymbolProperty9.symbols | 6 +- .../baselines/reference/parserharness.symbols | 650 +++++++-------- .../privacyAccessorDeclFile.errors.txt | 24 +- ...ivacyClassExtendsClauseDeclFile.errors.txt | 2 +- ...cyClassImplementsClauseDeclFile.errors.txt | 2 +- ...rivacyFunctionParameterDeclFile.errors.txt | 40 +- ...ivacyFunctionReturnTypeDeclFile.errors.txt | 44 +- ...yInterfaceExtendsClauseDeclFile.errors.txt | 2 +- .../reference/privacyVarDeclFile.errors.txt | 20 +- tests/baselines/reference/promiseType.symbols | 776 +++++++++--------- .../reference/promiseTypeStrictNull.symbols | 776 +++++++++--------- .../promiseVoidErrorCallback.symbols | 18 +- .../propertyAccessNumericLiterals.es6.symbols | 20 +- ...cessOnTypeParameterWithConstraints.symbols | 16 +- ...essOnTypeParameterWithConstraints4.symbols | 14 +- .../reachabilityCheckWithEmptyDefault.symbols | 4 +- .../reachabilityCheckWithEmptyDefault.types | 4 +- .../reference/reachabilityChecks7.symbols | 4 +- .../restParametersOfNonArrayTypes.symbols | 4 +- .../reference/returnStatements.symbols | 4 +- .../scopeResolutionIdentifiers.symbols | 4 +- .../sourceMapValidationFor.errors.txt | 8 +- .../reference/sourceMapValidationFor.symbols | 6 + .../reference/sourceMapValidationFor.types | 16 +- .../sourceMapValidationForIn.errors.txt | 29 - .../sourceMapValidationForIn.symbols | 12 + .../reference/sourceMapValidationForIn.types | 32 +- ...leFilesWithFileEndingWithInterface.symbols | 4 +- ...ipleFilesWithFileEndingWithInterface.types | 2 +- ...aticMembersUsingClassTypeParameter.symbols | 2 +- .../reference/stringIncludes.symbols | 8 +- ...stringLiteralTypeIsSubtypeOfString.symbols | 2 +- .../baselines/reference/subtypesOfAny.symbols | 2 +- .../reference/subtypesOfTypeParameter.symbols | 4 +- ...ypesOfTypeParameterWithConstraints.symbols | 56 +- ...pesOfTypeParameterWithConstraints2.symbols | 16 +- .../reference/subtypesOfUnion.symbols | 4 +- .../subtypingWithCallSignatures2.symbols | 4 +- .../subtypingWithConstructSignatures2.symbols | 4 +- .../superSymbolIndexedAccess1.symbols | 6 +- .../superSymbolIndexedAccess2.symbols | 18 +- .../superSymbolIndexedAccess3.symbols | 6 +- .../superSymbolIndexedAccess4.symbols | 6 +- .../reference/switchStatements.symbols | 4 +- .../reference/symbolDeclarationEmit1.symbols | 6 +- .../reference/symbolDeclarationEmit10.symbols | 12 +- .../reference/symbolDeclarationEmit11.symbols | 24 +- .../reference/symbolDeclarationEmit12.symbols | 30 +- .../reference/symbolDeclarationEmit13.symbols | 12 +- .../reference/symbolDeclarationEmit14.symbols | 12 +- .../reference/symbolDeclarationEmit2.symbols | 6 +- .../reference/symbolDeclarationEmit3.symbols | 18 +- .../reference/symbolDeclarationEmit4.symbols | 12 +- .../reference/symbolDeclarationEmit5.symbols | 6 +- .../reference/symbolDeclarationEmit6.symbols | 6 +- .../reference/symbolDeclarationEmit7.symbols | 6 +- .../reference/symbolDeclarationEmit8.symbols | 6 +- .../reference/symbolDeclarationEmit9.symbols | 6 +- .../reference/symbolProperty10.symbols | 12 +- .../reference/symbolProperty11.symbols | 6 +- .../reference/symbolProperty12.symbols | 12 +- .../reference/symbolProperty13.symbols | 12 +- .../reference/symbolProperty14.symbols | 12 +- .../reference/symbolProperty15.symbols | 6 +- .../reference/symbolProperty16.symbols | 12 +- .../reference/symbolProperty17.symbols | 12 +- .../reference/symbolProperty18.symbols | 36 +- .../reference/symbolProperty19.symbols | 24 +- .../reference/symbolProperty2.symbols | 2 +- .../reference/symbolProperty20.symbols | 24 +- .../reference/symbolProperty21.symbols | 30 +- .../reference/symbolProperty22.symbols | 16 +- .../reference/symbolProperty23.symbols | 12 +- .../reference/symbolProperty24.symbols | 12 +- .../reference/symbolProperty25.symbols | 12 +- .../reference/symbolProperty26.symbols | 12 +- .../reference/symbolProperty27.symbols | 12 +- .../reference/symbolProperty28.symbols | 12 +- .../reference/symbolProperty29.symbols | 6 +- .../reference/symbolProperty3.symbols | 2 +- .../reference/symbolProperty30.symbols | 6 +- .../reference/symbolProperty31.symbols | 6 +- .../reference/symbolProperty32.symbols | 6 +- .../reference/symbolProperty33.symbols | 6 +- .../reference/symbolProperty34.symbols | 6 +- .../reference/symbolProperty35.symbols | 12 +- .../reference/symbolProperty36.symbols | 12 +- .../reference/symbolProperty37.symbols | 12 +- .../reference/symbolProperty38.symbols | 12 +- .../reference/symbolProperty39.symbols | 24 +- .../reference/symbolProperty4.symbols | 6 +- .../reference/symbolProperty40.symbols | 30 +- .../reference/symbolProperty41.symbols | 30 +- .../reference/symbolProperty42.symbols | 18 +- .../reference/symbolProperty43.symbols | 12 +- .../reference/symbolProperty44.symbols | 12 +- .../reference/symbolProperty45.symbols | 12 +- .../reference/symbolProperty46.symbols | 24 +- .../reference/symbolProperty47.symbols | 24 +- .../reference/symbolProperty5.symbols | 18 +- .../reference/symbolProperty50.symbols | 6 +- .../reference/symbolProperty51.symbols | 6 +- .../reference/symbolProperty52.symbols | 4 +- .../reference/symbolProperty53.symbols | 12 +- .../reference/symbolProperty54.symbols | 6 +- .../reference/symbolProperty55.symbols | 12 +- .../reference/symbolProperty56.symbols | 6 +- .../reference/symbolProperty57.symbols | 8 +- .../reference/symbolProperty58.symbols | 4 +- .../reference/symbolProperty59.symbols | 6 +- .../reference/symbolProperty6.symbols | 24 +- .../reference/symbolProperty7.symbols | 8 +- .../reference/symbolProperty8.symbols | 12 +- .../reference/symbolProperty9.symbols | 12 +- tests/baselines/reference/symbolType1.symbols | 16 +- .../baselines/reference/symbolType10.symbols | 6 +- .../baselines/reference/symbolType11.symbols | 6 +- .../baselines/reference/symbolType12.symbols | 6 +- .../baselines/reference/symbolType13.symbols | 2 +- .../baselines/reference/symbolType14.symbols | 2 +- .../baselines/reference/symbolType15.symbols | 2 +- .../baselines/reference/symbolType16.symbols | 2 +- tests/baselines/reference/symbolType2.symbols | 12 +- tests/baselines/reference/symbolType3.symbols | 30 +- tests/baselines/reference/symbolType4.symbols | 6 +- tests/baselines/reference/symbolType5.symbols | 6 +- tests/baselines/reference/symbolType6.symbols | 6 +- tests/baselines/reference/symbolType7.symbols | 6 +- tests/baselines/reference/symbolType8.symbols | 6 +- tests/baselines/reference/symbolType9.symbols | 6 +- ...icDefaultExportsWithDynamicImports.symbols | 4 +- .../taggedTemplateContextualTyping1.symbols | 4 +- .../taggedTemplateContextualTyping2.symbols | 4 +- ...mplateStringsTypeArgumentInference.symbols | 4 +- ...ateStringsTypeArgumentInferenceES6.symbols | 26 +- ...tringsWithIncompatibleTypedTagsES6.symbols | 2 +- ...ithManyCallAndMemberExpressionsES6.symbols | 2 +- ...StringsWithOverloadResolution1_ES6.symbols | 8 +- ...StringsWithOverloadResolution2_ES6.symbols | 4 +- ...lateStringsWithOverloadResolution3.symbols | 2 +- ...StringsWithOverloadResolution3_ES6.symbols | 30 +- ...gedTemplateStringsWithTypedTagsES6.symbols | 2 +- ...hIncompleteNoSubstitutionTemplate1.symbols | 2 +- ...hIncompleteNoSubstitutionTemplate2.symbols | 2 +- ...WithIncompleteTemplateExpressions1.symbols | 2 +- ...WithIncompleteTemplateExpressions2.symbols | 2 +- ...WithIncompleteTemplateExpressions3.symbols | 2 +- ...WithIncompleteTemplateExpressions4.symbols | 2 +- ...WithIncompleteTemplateExpressions5.symbols | 2 +- ...WithIncompleteTemplateExpressions6.symbols | 2 +- .../templateStringInInstanceOfES6.symbols | 2 +- ...ateStringWithEmbeddedInstanceOfES6.symbols | 2 +- ...teStringWithEmbeddedNewOperatorES6.symbols | 2 +- ...lateStringWithEmbeddedUnaryPlusES6.symbols | 2 +- ...emplateStringWithPropertyAccessES6.symbols | 4 +- ...StringsArrayTypeRedefinedInES6Mode.symbols | 4 +- .../baselines/reference/thisBinding2.symbols | 4 +- tests/baselines/reference/thisBinding2.types | 4 +- .../reference/thisTypeInClasses.symbols | 4 +- .../reference/thisTypeInInterfaces.symbols | 4 +- .../reference/throwStatements.symbols | 4 +- .../reference/tooManyTypeParameters1.symbols | 4 +- ...InterfacesWithDifferentConstraints.symbols | 8 +- ...edInterfacesWithDifferingOverloads.symbols | 12 +- .../typeArgumentConstraintResolution1.symbols | 8 +- .../reference/typeArgumentInference.symbols | 8 +- ...typeArgumentInferenceApparentType1.symbols | 2 +- ...typeArgumentInferenceApparentType2.symbols | 4 +- ...entInferenceConstructSignatures.errors.txt | 18 +- ...gumentInferenceConstructSignatures.symbols | 4 + ...ArgumentInferenceConstructSignatures.types | 24 +- ...mentInferenceTransitiveConstraints.symbols | 10 +- ...rgumentInferenceWithConstraints.errors.txt | 29 +- ...peArgumentInferenceWithConstraints.symbols | 5 + ...typeArgumentInferenceWithConstraints.types | 38 +- .../reference/typeGuardsNestedAssignments.js | 2 +- .../typeInferenceLiteralUnion.symbols | 2 +- .../typeOfThisInMemberFunctions.symbols | 2 +- .../typeParameterAssignability2.symbols | 20 +- .../typeParameterConstraints1.symbols | 2 +- .../typeParameterUsedAsConstraint.symbols | 20 +- ...ParametersAreIdenticalToThemselves.symbols | 14 +- .../typeParametersShouldNotBeEqual2.symbols | 4 +- tests/baselines/reference/typedArrays.symbols | 384 ++++----- .../typedArraysCrossAssignability01.symbols | 18 +- .../undefinedAssignableToEveryType.symbols | 4 +- .../undefinedIsSubtypeOfEverything.symbols | 2 +- .../reference/underscoreTest1.symbols | 28 +- .../baselines/reference/underscoreTest1.types | 24 +- .../unicodeIdentifierName2.errors.txt | 5 +- .../reference/unicodeIdentifierName2.symbols | 1 + .../reference/unicodeIdentifierName2.types | 4 +- ...ypeIfEveryConstituentTypeIsSubtype.symbols | 2 +- .../reference/unionTypeCallSignatures.symbols | 10 +- .../unionTypeCallSignatures2.symbols | 4 +- .../unionTypeConstructSignatures.symbols | 10 +- .../reference/unionTypeIndexSignature.symbols | 6 +- .../unknownSymbolOffContextualType1.symbols | 18 +- .../unknownSymbolOffContextualType1.types | 6 +- .../useObjectValuesAndEntries3.symbols | 4 +- ...ariableDeclarationInStrictMode1.errors.txt | 2 +- .../wrappedAndRecursiveConstraints.symbols | 4 +- .../compiler/binopAssignmentShouldHaveType.ts | 1 + .../compiler/capturedLetConstInLoop13.ts | 1 + .../classExpressionWithStaticProperties3.ts | 3 +- ...classExpressionWithStaticPropertiesES63.ts | 3 +- .../classMemberInitializerWithLamdaScoping.ts | 1 + ...classMemberInitializerWithLamdaScoping2.ts | 1 + ...classMemberInitializerWithLamdaScoping5.ts | 1 + .../classMemberWithMissingIdentifier2.ts | 1 + .../collisionRestParameterUnderscoreIUsage.ts | 1 + .../collisionSuperAndNameResolution.ts | 1 + ...sionThisExpressionAndLocalVarInFunction.ts | 1 + ...lisionThisExpressionAndLocalVarInLambda.ts | 1 + ...ollisionThisExpressionAndNameResolution.ts | 1 + .../collisionThisExpressionAndParameter.ts | 33 +- tests/cases/compiler/constEnumErrors.ts | 1 + .../contextualTypingOfTooShortOverloads.ts | 1 + .../compiler/decoratorWithUnderscoreMethod.ts | 3 +- tests/cases/compiler/fatarrowfunctions.ts | 1 + .../compiler/fatarrowfunctionsInFunctions.ts | 1 + .../genericMethodOverspecialization.ts | 1 + .../cases/compiler/interfaceExtendsClass1.ts | 1 + tests/cases/compiler/lambdaArgCrash.ts | 1 + .../letConstMatchingParameterNames.ts | 1 + .../compiler/maximum10SpellingSuggestions.ts | 1 + tests/cases/compiler/moduleVariables.ts | 1 + .../module_augmentExistingAmbientVariable.ts | 1 + .../module_augmentExistingVariable.ts | 1 + ...sionThisExpressionAndLocalVarInFunction.ts | 1 + ...nThisExpressionInFunctionAndVarInGlobal.ts | 1 + ...ericLiteralsWithTrailingDecimalPoints01.ts | 1 + .../cases/compiler/objectLitArrayDeclNoNew.ts | 1 + .../overloadingStaticFunctionsInFunctions.ts | 1 + .../compiler/recursiveClassReferenceTest.ts | 1 + .../compiler/recursiveNamedLambdaCall.ts | 1 + ...veSpecializationOfExtendedTypeWithError.ts | 1 + tests/cases/compiler/selfInLambdas.ts | 1 + tests/cases/compiler/selfRef.ts | 1 + tests/cases/compiler/shebangError.ts | 1 + .../sourceMap-StringLiteralWithNewLine.ts | 1 + ...tionDestructuringForArrayBindingPattern.ts | 1 + ...ionDestructuringForArrayBindingPattern2.ts | 1 + ...ringForArrayBindingPatternDefaultValues.ts | 1 + ...ingForArrayBindingPatternDefaultValues2.ts | 1 + ...ionDestructuringForObjectBindingPattern.ts | 1 + ...onDestructuringForObjectBindingPattern2.ts | 1 + ...ingForObjectBindingPatternDefaultValues.ts | 1 + ...ngForObjectBindingPatternDefaultValues2.ts | 1 + ...onDestructuringForOfArrayBindingPattern.ts | 1 + ...nDestructuringForOfArrayBindingPattern2.ts | 1 + ...ngForOfArrayBindingPatternDefaultValues.ts | 1 + ...gForOfArrayBindingPatternDefaultValues2.ts | 1 + ...nDestructuringForOfObjectBindingPattern.ts | 1 + ...DestructuringForOfObjectBindingPattern2.ts | 1 + ...gForOfObjectBindingPatternDefaultValues.ts | 1 + ...ForOfObjectBindingPatternDefaultValues2.ts | 1 + ...ringParameterNestedObjectBindingPattern.ts | 1 + ...NestedObjectBindingPatternDefaultValues.ts | 1 + ...tructuringParameterObjectBindingPattern.ts | 1 + ...ameterObjectBindingPatternDefaultValues.ts | 1 + ...tructuringParametertArrayBindingPattern.ts | 1 + ...ructuringParametertArrayBindingPattern2.ts | 1 + ...ametertArrayBindingPatternDefaultValues.ts | 1 + ...metertArrayBindingPatternDefaultValues2.ts | 1 + ...alidationDestructuringVariableStatement.ts | 1 + ...lidationDestructuringVariableStatement1.ts | 1 + ...ingVariableStatementArrayBindingPattern.ts | 1 + ...ngVariableStatementArrayBindingPattern2.ts | 1 + ...ngVariableStatementArrayBindingPattern3.ts | 1 + ...atementArrayBindingPatternDefaultValues.ts | 1 + ...tementArrayBindingPatternDefaultValues2.ts | 1 + ...tementArrayBindingPatternDefaultValues3.ts | 1 + ...ructuringVariableStatementDefaultValues.ts | 1 + ...ableStatementNestedObjectBindingPattern.ts | 1 + ...edObjectBindingPatternWithDefaultValues.ts | 1 + .../compiler/staticInstanceResolution.ts | 1 + tests/cases/compiler/staticsInAFunction.ts | 1 + tests/cases/compiler/unusedLocalProperty.ts | 3 +- .../compiler/unusedLocalsAndObjectSpread.ts | 3 +- ...eclaratorResolvedDuringContextualTyping.ts | 1 + .../importCallExpression4ESNext.ts | 1 - ...portCallExpressionNoModuleKindSpecified.ts | 1 - .../destructuring/iterableArrayPattern28.ts | 1 + .../es6/for-ofStatements/for-of39.ts | 3 +- ...ectLiteralShorthandPropertiesAssignment.ts | 3 +- ...LiteralShorthandPropertiesAssignmentES6.ts | 3 +- ...teralShorthandPropertiesAssignmentError.ts | 3 +- ...iesAssignmentErrorFromMissingIdentifier.ts | 3 +- ...eralShorthandPropertiesFunctionArgument.ts | 3 +- ...ralShorthandPropertiesFunctionArgument2.ts | 3 +- .../parserClassDeclaration17.ts | 1 + ...rserMemberAccessAfterPostfixExpression1.ts | 1 + .../ecmascript5/RealWorld/parserharness.ts | 3 +- .../parser/ecmascript5/parserRealSource5.ts | 1 + .../parserShorthandPropertyAssignment1.ts | 1 + .../references/library-reference-2.ts | 2 +- ...objectTypeHidingMembersOfExtendedObject.ts | 1 + ...ypeWithStringIndexerHidingObjectIndexer.ts | 1 + .../conformance/types/never/neverInference.ts | 1 + .../types/spread/objectSpreadNegativeParse.ts | 1 + 790 files changed, 5086 insertions(+), 4477 deletions(-) create mode 100644 src/harness/compiler.ts create mode 100644 src/harness/documents.ts create mode 100644 src/harness/utils.ts delete mode 100644 tests/baselines/reference/ES5For-of1.errors.txt delete mode 100644 tests/baselines/reference/ES5For-of22.errors.txt delete mode 100644 tests/baselines/reference/ES5For-of23.errors.txt delete mode 100644 tests/baselines/reference/ES5For-of33.errors.txt delete mode 100644 tests/baselines/reference/bindingPatternInParameter01.errors.txt delete mode 100644 tests/baselines/reference/customEventDetail.errors.txt delete mode 100644 tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.errors.txt delete mode 100644 tests/baselines/reference/infinitelyExpandingTypes2.errors.txt delete mode 100644 tests/baselines/reference/inlineSourceMap.errors.txt delete mode 100644 tests/baselines/reference/inlineSources.errors.txt delete mode 100644 tests/baselines/reference/inlineSources2.errors.txt delete mode 100644 tests/baselines/reference/letShadowedByNameInNestedScope.errors.txt delete mode 100644 tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt delete mode 100644 tests/baselines/reference/parserInExpression1.errors.txt delete mode 100644 tests/baselines/reference/parserNotHexLiteral1.errors.txt delete mode 100644 tests/baselines/reference/parserOverloadOnConstants1.errors.txt delete mode 100644 tests/baselines/reference/sourceMapValidationForIn.errors.txt diff --git a/Jakefile.js b/Jakefile.js index 252932ff51164..15ad9c7be5210 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -91,88 +91,7 @@ var languageServiceLibrarySources = filesFromConfig(path.join(serverDirectory, " var typesMapOutputPath = path.join(builtLocalDirectory, 'typesMap.json'); -var harnessCoreSources = [ - "harness.ts", - "collections.ts", - "vpath.ts", - "events.ts", - "vfs.ts", - "virtualFileSystemWithWatch.ts", - "sourceMapRecorder.ts", - "harnessLanguageService.ts", - "fourslash.ts", - "runnerbase.ts", - "compilerRunner.ts", - "typeWriter.ts", - "fourslashRunner.ts", - "projectsRunner.ts", - "loggedIO.ts", - "rwcRunner.ts", - "userRunner.ts", - "test262Runner.ts", - "./parallel/shared.ts", - "./parallel/host.ts", - "./parallel/worker.ts", - "runner.ts" -].map(function (f) { - return path.join(harnessDirectory, f); -}); - -var harnessSources = harnessCoreSources.concat([ - "incrementalParser.ts", - "jsDocParsing.ts", - "services/colorization.ts", - "services/documentRegistry.ts", - "services/preProcessFile.ts", - "services/patternMatcher.ts", - "session.ts", - "versionCache.ts", - "convertToBase64.ts", - "transpile.ts", - "reuseProgramStructure.ts", - "textStorage.ts", - "moduleResolution.ts", - "tsconfigParsing.ts", - "builder.ts", - "commandLineParsing.ts", - "configurationExtension.ts", - "convertCompilerOptionsFromJson.ts", - "convertTypeAcquisitionFromJson.ts", - "tsserverProjectSystem.ts", - "tscWatchMode.ts", - "compileOnSave.ts", - "typingsInstaller.ts", - "projectErrors.ts", - "matchFiles.ts", - "initializeTSConfig.ts", - "extractConstants.ts", - "extractFunctions.ts", - "extractRanges.ts", - "extractTestHelpers.ts", - "printer.ts", - "textChanges.ts", - "telemetry.ts", - "transform.ts", - "customTransforms.ts", - "programMissingFiles.ts", - "symbolWalker.ts", - "languageService.ts", - "publicApi.ts", - "hostNewLineSupport.ts", -].map(function (f) { - return path.join(unittestsDirectory, f); -})).concat([ - "protocol.ts", - "utilities.ts", - "scriptVersionCache.ts", - "scriptInfo.ts", - "project.ts", - "typingsCache.ts", - "editorServices.ts", - "session.ts", -].map(function (f) { - return path.join(serverDirectory, f); -})); +var harnessSources = filesFromConfig("./src/harness/tsconfig.json"); var es2015LibrarySources = [ "es2015.core.d.ts", diff --git a/src/compiler/core.ts b/src/compiler/core.ts index f1322f109ccfe..64d6455e67ad4 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1749,7 +1749,7 @@ namespace ts { } function getDiagnosticFileName(diagnostic: Diagnostic): string { - return diagnostic.file ? diagnostic.file.fileName : undefined; + return diagnostic.file ? diagnostic.file.path : undefined; } export function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): Comparison { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 7a1d88d3bfd71..32d778029f37f 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -50,7 +50,8 @@ namespace ts { // JavaScript files are always LanguageVariant.JSX, as JSX syntax is allowed in .js files also. // So for JavaScript files, '.jsx' is only emitted if the input was '.jsx', and JsxEmit.Preserve. // For TypeScript, the only time to emit with a '.jsx' extension, is on JSX input, and JsxEmit.Preserve - function getOutputExtension(sourceFile: SourceFile, options: CompilerOptions): Extension { + /* @internal */ + export function getOutputExtension(sourceFile: SourceFile, options: CompilerOptions): Extension { if (options.jsx === JsxEmit.Preserve) { if (isSourceFileJavaScript(sourceFile)) { if (fileExtensionIs(sourceFile.fileName, Extension.Jsx)) { diff --git a/src/harness/compiler.ts b/src/harness/compiler.ts new file mode 100644 index 0000000000000..c6f0f831f81f2 --- /dev/null +++ b/src/harness/compiler.ts @@ -0,0 +1,377 @@ +/// +/// +/// +/// +/// +/// + +namespace compiler { + import TextDocument = documents.TextDocument; + import SourceMap = documents.SourceMap; + import KeyedCollection = collections.KeyedCollection; + import VirtualFileSystem = vfs.VirtualFileSystem; + + export class CompilerHost { + public readonly vfs: vfs.VirtualFileSystem; + public readonly defaultLibLocation: string; + public readonly outputs: TextDocument[] = []; + public readonly traces: string[] = []; + + private _setParentNodes: boolean; + private _sourceFiles: KeyedCollection; + private _newLine: string; + private _parseConfigHost: ParseConfigHost; + + constructor(vfs: VirtualFileSystem, options: ts.CompilerOptions, setParentNodes = false) { + this.vfs = vfs; + this.defaultLibLocation = vfs.metadata.get("defaultLibLocation") || ""; + this._sourceFiles = new KeyedCollection(this.vfs.pathComparer); + this._newLine = options.newLine === ts.NewLineKind.LineFeed ? "\n" : "\r\n"; + this._setParentNodes = setParentNodes; + } + + public get parseConfigHost() { + return this._parseConfigHost || (this._parseConfigHost = new ParseConfigHost(this.vfs)); + } + + public getCurrentDirectory(): string { + return this.vfs.currentDirectory; + } + + public useCaseSensitiveFileNames(): boolean { + return this.vfs.useCaseSensitiveFileNames; + } + + public getNewLine(): string { + return this._newLine; + } + + public getCanonicalFileName(fileName: string): string { + return this.vfs.useCaseSensitiveFileNames ? fileName : fileName.toLowerCase(); + } + + public fileExists(fileName: string): boolean { + return this.vfs.fileExists(fileName); + } + + public directoryExists(directoryName: string): boolean { + return this.vfs.directoryExists(directoryName); + } + + public getDirectories(path: string): string[] { + const entry = this.vfs.getDirectory(path); + return entry ? entry.getDirectories().map(dir => dir.name) : []; + } + + public readFile(path: string): string | undefined { + const entry = this.vfs.getFile(path); + const content = entry && entry.content && utils.removeByteOrderMark(entry.content); + return content === undefined ? undefined : + vpath.extname(path) === ".json" ? utils.removeComments(content, utils.CommentRemoval.leadingAndTrailing) : + content; + } + + public writeFile(fileName: string, content: string, writeByteOrderMark: boolean) { + // NOTE(rbuckton): Old harness emits "\u00EF\u00BB\u00BF" for UTF8 BOM, but compiler emits "\uFEFF". Compiler is wrong, as "\uFEFF" is a UTF16 BOM. + if (writeByteOrderMark) content = "\u00EF\u00BB\u00BF" + content; + const entry = this.vfs.addFile(fileName, content, { overwrite: true }); + if (entry) { + const document = new TextDocument(fileName, content); + document.meta.set("fileName", fileName); + entry.metadata.set("document", document); + const index = this.outputs.findIndex(output => this.vfs.pathComparer(document.file, output.file) === 0); + if (index < 0) { + this.outputs.push(document); + } + else { + this.outputs[index] = document; + } + } + } + + public trace(s: string): void { + this.traces.push(s); + } + + public realpath(path: string): string { + const entry = this.vfs.getEntry(path, { followSymlinks: true }); + return entry && entry.path || path; + } + + public getDefaultLibLocation(): string { + return vpath.resolve(this.vfs.currentDirectory, this.defaultLibLocation); + } + + public getDefaultLibFileName(options: ts.CompilerOptions): string { + return vpath.resolve(this.getDefaultLibLocation(), ts.getDefaultLibFileName(options)); + } + + public getSourceFile(fileName: string, languageVersion: number): ts.SourceFile | undefined { + const canonicalFileName = this.getCanonicalFileName(vpath.resolve(this.vfs.currentDirectory, fileName)); + const existing = this._sourceFiles.get(canonicalFileName); + if (existing) return existing; + const file = this.vfs.getFile(canonicalFileName); + if (file) { + let content = file.content; + if (content !== undefined) { + content = utils.removeByteOrderMark(content); + + // We cache and reuse source files for files we know shouldn't change. + const shouldCache = vpath.isDefaultLibrary(fileName) || + vpath.beneath("/.ts", file.path, !this.vfs.useCaseSensitiveFileNames) || + vpath.beneath("/.lib", file.path, !this.vfs.useCaseSensitiveFileNames); + + const cacheKey = shouldCache && `SourceFile[languageVersion=${languageVersion},setParentNodes=${this._setParentNodes}]`; + if (cacheKey) { + const sourceFileFromMetadata = file.metadata.get(cacheKey) as ts.SourceFile | undefined; + if (sourceFileFromMetadata) { + this._sourceFiles.set(canonicalFileName, sourceFileFromMetadata); + return sourceFileFromMetadata; + } + } + + const parsed = ts.createSourceFile(fileName, content, languageVersion, this._setParentNodes); + this._sourceFiles.set(canonicalFileName, parsed); + + if (cacheKey) { + // store the cached source file on the unshadowed file. + let rootFile = file; + while (rootFile.shadowRoot) rootFile = rootFile.shadowRoot; + rootFile.metadata.set(cacheKey, parsed); + } + + return parsed; + } + } + } + } + + export class ParseConfigHost { + public readonly vfs: VirtualFileSystem; + + constructor(vfs: VirtualFileSystem) { + this.vfs = vfs; + } + + public get useCaseSensitiveFileNames() { + return this.vfs.useCaseSensitiveFileNames; + } + + public readDirectory(path: string, extensions: string[], excludes: string[], includes: string[], depth: number): string[] { + return ts.matchFiles( + path, + extensions, + excludes, + includes, + this.vfs.useCaseSensitiveFileNames, + this.vfs.currentDirectory, + depth, + path => this.vfs.getAccessibleFileSystemEntries(path)); + } + + public fileExists(path: string) { + return this.vfs.fileExists(path); + } + + public readFile(path: string) { + return this.vfs.readFile(path); + } + } + + export interface Project { + file: string; + config?: ts.ParsedCommandLine; + errors?: ts.Diagnostic[]; + } + + export function readProject(host: ParseConfigHost, project: string | undefined, existingOptions?: ts.CompilerOptions): Project | undefined { + if (project) { + project = host.vfs.stringComparer(vpath.basename(project), "tsconfig.json") === 0 ? project : + vpath.combine(project, "tsconfig.json"); + } + else { + const dir = host.vfs.getDirectory(host.vfs.currentDirectory); + const projectFile = dir && dir.findFile("tsconfig.json", "ancestors-or-self"); + project = projectFile && projectFile.path; + } + + if (project) { + // TODO(rbuckton): Do we need to resolve this? Resolving breaks projects tests. + // project = vpath.resolve(host.vfs.currentDirectory, project); + + // read the config file + const readResult = ts.readConfigFile(project, path => host.readFile(path)); + if (readResult.error) { + return { file: project, errors: [readResult.error] }; + } + + // parse the config file + const config = ts.parseJsonConfigFileContent(readResult.config, host, vpath.dirname(project), existingOptions); + return { file: project, errors: config.errors, config }; + } + } + + export interface CompilationOutput { + readonly input: TextDocument; + readonly js: TextDocument | undefined; + readonly dts: TextDocument | undefined; + readonly map: TextDocument | undefined; + } + + export class CompilationResult { + public readonly host: CompilerHost; + public readonly program: ts.Program | undefined; + public readonly result: ts.EmitResult | undefined; + public readonly options: ts.CompilerOptions; + public readonly diagnostics: ts.Diagnostic[]; + public readonly js: KeyedCollection; + public readonly dts: KeyedCollection; + public readonly maps: KeyedCollection; + + private _inputs: TextDocument[] = []; + private _inputsAndOutputs: KeyedCollection; + + constructor(host: CompilerHost, options: ts.CompilerOptions, program: ts.Program | undefined, result: ts.EmitResult | undefined, diagnostics: ts.Diagnostic[]) { + this.host = host; + this.program = program; + this.result = result; + this.diagnostics = diagnostics; + this.options = program ? program.getCompilerOptions() : options; + + // collect outputs + this.js = new KeyedCollection(this.vfs.pathComparer); + this.dts = new KeyedCollection(this.vfs.pathComparer); + this.maps = new KeyedCollection(this.vfs.pathComparer); + for (const document of this.host.outputs) { + if (vpath.isJavaScript(document.file)) { + this.js.set(document.file, document); + } + else if (vpath.isDeclaration(document.file)) { + this.dts.set(document.file, document); + } + else if (vpath.isSourceMap(document.file)) { + this.maps.set(document.file, document); + } + } + + // correlate inputs and outputs + this._inputsAndOutputs = new KeyedCollection(this.vfs.pathComparer); + if (program) { + for (const sourceFile of program.getSourceFiles()) { + if (sourceFile) { + const input = new TextDocument(sourceFile.fileName, sourceFile.text); + this._inputs.push(input); + if (!vpath.isDeclaration(sourceFile.fileName)) { + const outputs = { + input, + js: this.js.get(this.getOutputPath(sourceFile.fileName, ts.getOutputExtension(sourceFile, this.options))), + dts: this.dts.get(this.getOutputPath(sourceFile.fileName, ".d.ts", this.options.declarationDir)), + map: this.maps.get(this.getOutputPath(sourceFile.fileName, ts.getOutputExtension(sourceFile, this.options) + ".map")) + }; + + this._inputsAndOutputs.set(sourceFile.fileName, outputs); + if (outputs.js) this._inputsAndOutputs.set(outputs.js.file, outputs); + if (outputs.dts) this._inputsAndOutputs.set(outputs.dts.file, outputs); + if (outputs.map) this._inputsAndOutputs.set(outputs.map.file, outputs); + } + } + } + } + } + + public get vfs() { + return this.host.vfs; + } + + public get inputs(): ReadonlyArray { + return this._inputs; + } + + public get outputs(): ReadonlyArray { + return this.host.outputs; + } + + public get traces(): ReadonlyArray { + return this.host.traces; + } + + public get emitSkipped(): boolean { + return this.result && this.result.emitSkipped || false; + } + + public get singleFile(): boolean { + return !!this.options.outFile || !!this.options.out; + } + + public get commonSourceDirectory(): string { + const common = this.program && this.program.getCommonSourceDirectory() || ""; + return common && vpath.combine(this.vfs.currentDirectory, common); + } + + public getInputsAndOutputs(path: string): CompilationOutput | undefined { + return this._inputsAndOutputs.get(vpath.resolve(this.vfs.currentDirectory, path)); + } + + public getInput(path: string): TextDocument | undefined { + const outputs = this.getInputsAndOutputs(path); + return outputs && outputs.input; + } + + public getOutput(path: string, kind: "js" | "dts" | "map"): TextDocument | undefined { + const outputs = this.getInputsAndOutputs(path); + return outputs && outputs[kind]; + } + + public getSourceMap(path: string): SourceMap | undefined { + if (this.options.noEmit || vpath.isDeclaration(path)) return undefined; + if (this.options.inlineSourceMap) { + const document = this.getOutput(path, "js"); + return document && SourceMap.fromSource(document.text); + } + if (this.options.sourceMap) { + const document = this.getOutput(path, "map"); + return document && new SourceMap(document.file, document.text); + } + } + + public getOutputPath(path: string, ext: string, outDir: string | undefined = this.options.outDir) { + if (outDir) { + path = vpath.resolve(this.vfs.currentDirectory, path); + const common = this.commonSourceDirectory; + if (!common) return vpath.changeExtension(path, ext); + path = vpath.relative(common, path, !this.vfs.useCaseSensitiveFileNames); + path = vpath.combine(vpath.resolve(this.vfs.currentDirectory, outDir), path); + return vpath.changeExtension(path, ext); + } + const outFile = vpath.resolve(this.vfs.currentDirectory, this.options.outFile || this.options.out || path); + return vpath.changeExtension(outFile, ext); + } + } + + export function compileFiles(host: CompilerHost, rootFiles: string[] | undefined, compilerOptions: ts.CompilerOptions) { + // establish defaults (aligns with old harness) + if (compilerOptions.project || !rootFiles || rootFiles.length === 0) { + const project = readProject(host.parseConfigHost, compilerOptions.project, compilerOptions); + if (project) { + if (project.errors && project.errors.length > 0) { + return new CompilationResult(host, compilerOptions, /*program*/ undefined, /*result*/ undefined, project.errors); + } + if (project.config) { + rootFiles = project.config.fileNames; + compilerOptions = project.config.options; + } + } + delete compilerOptions.project; + } + + if (compilerOptions.target === undefined) compilerOptions.target = ts.ScriptTarget.ES3; + if (compilerOptions.newLine === undefined) compilerOptions.newLine = ts.NewLineKind.CarriageReturnLineFeed; + if (compilerOptions.skipDefaultLibCheck === undefined) compilerOptions.skipDefaultLibCheck = true; + if (compilerOptions.noErrorTruncation === undefined) compilerOptions.noErrorTruncation = true; + + const program = ts.createProgram(rootFiles || [], compilerOptions, host); + const emitResult = program.emit(); + const errors = ts.getPreEmitDiagnostics(program); + return new CompilationResult(host, compilerOptions, program, emitResult, errors); + } +} \ No newline at end of file diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 30c5e47949f44..d8f82abe4eca4 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -1,6 +1,10 @@ /// /// /// +/// +/// +/// +/// const enum CompilerTestType { Conformance, @@ -65,7 +69,7 @@ class CompilerBaselineRunner extends RunnerBase { let otherFiles: Harness.Compiler.TestFile[]; before(() => { - justName = fileName.replace(/^.*[\\\/]/, ""); // strips the fileName from the path. + justName = vpath.basename(fileName); const content = Harness.IO.readFile(fileName); const rootDir = fileName.indexOf("conformance") === -1 ? "tests/cases/compiler/" : ts.getDirectoryPath(fileName) + "/"; const testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName, rootDir); @@ -141,7 +145,7 @@ class CompilerBaselineRunner extends RunnerBase { it (`Correct module resolution tracing for ${fileName}`, () => { if (options.traceResolution) { Harness.Baseline.runBaseline(justName.replace(/\.tsx?$/, ".trace.json"), () => { - return JSON.stringify(result.traceResults || [], undefined, 4); + return utils.removeTestPathPrefixes(JSON.stringify(result.traceResults || [], undefined, 4)); }); } }); @@ -150,7 +154,7 @@ class CompilerBaselineRunner extends RunnerBase { it("Correct sourcemap content for " + fileName, () => { if (options.sourceMap || options.inlineSourceMap) { Harness.Baseline.runBaseline(justName.replace(/\.tsx?$/, ".sourcemap.txt"), () => { - const record = result.getSourceMapRecord(); + const record = utils.removeTestPathPrefixes(result.getSourceMapRecord()); if ((options.noEmitOnError && result.errors.length !== 0) || record === undefined) { // Because of the noEmitOnError option no files are created. We need to return null because baselining isn't required. /* tslint:disable:no-null-keyword */ @@ -222,4 +226,4 @@ class CompilerBaselineRunner extends RunnerBase { } } } -} +} \ No newline at end of file diff --git a/src/harness/documents.ts b/src/harness/documents.ts new file mode 100644 index 0000000000000..b460cc8393f07 --- /dev/null +++ b/src/harness/documents.ts @@ -0,0 +1,169 @@ +/// + +namespace documents { + export class TextDocument { + public readonly meta: Map; + public readonly file: string; + public readonly text: string; + + private _lineStarts: number[] | undefined; + + constructor(file: string, content: string, meta?: Map) { + this.file = file; + this.text = content; + this.meta = meta || new Map(); + } + + public get lineStarts(): number[] { + return this._lineStarts || (this._lineStarts = ts.computeLineStarts(this.text)); + } + } + + export interface RawSourceMap { + version: number; + file: string; + sourceRoot?: string; + sources: string[]; + sourcesContent?: string[]; + names: string[]; + mappings: string; + } + + export interface Mapping { + mappingIndex: number; + emittedLine: number; + emittedColumn: number; + sourceIndex: number; + sourceLine: number; + sourceColumn: number; + nameIndex?: number; + } + + const mappingRegExp = /([A-Za-z0-9+/]+),?|(;)|./g; + const sourceMappingURLRegExp = /^\/\/[#@]\s*sourceMappingURL\s*=\s*(.*?)\s*$/mig; + const dataURLRegExp = /^data:application\/json;base64,([a-z0-9+/=]+)$/i; + + export class SourceMap { + public readonly raw: RawSourceMap; + public readonly mapFile: string | undefined; + public readonly version: number; + public readonly file: string; + public readonly sourceRoot: string | undefined; + public readonly sources: ReadonlyArray = []; + public readonly sourcesContent: ReadonlyArray | undefined; + public readonly mappings: ReadonlyArray = []; + public readonly names: ReadonlyArray | undefined; + + private _emittedLineMappings: Mapping[][] = []; + private _sourceLineMappings: Mapping[][][] = []; + + constructor(mapFile: string | undefined, data: string | RawSourceMap) { + this.raw = typeof data === "string" ? JSON.parse(data) as RawSourceMap : data; + this.mapFile = mapFile; + this.version = this.raw.version; + this.file = this.raw.file; + this.sourceRoot = this.raw.sourceRoot; + this.sources = this.raw.sources; + this.sourcesContent = this.raw.sourcesContent; + this.names = this.raw.names; + + // populate mappings + const mappings: Mapping[] = []; + let emittedLine = 0; + let emittedColumn = 0; + let sourceIndex = 0; + let sourceLine = 0; + let sourceColumn = 0; + let nameIndex = 0; + let match: RegExpExecArray | null; + while (match = mappingRegExp.exec(this.raw.mappings)) { + if (match[1]) { + const segment = decodeVLQ(match[1]); + if (segment.length !== 1 && segment.length !== 4 && segment.length !== 5) { + throw new Error("Invalid VLQ"); + } + + emittedColumn += segment[0]; + if (segment.length >= 4) { + sourceIndex += segment[1]; + sourceLine += segment[2]; + sourceColumn += segment[3]; + } + + const mapping: Mapping = { mappingIndex: mappings.length, emittedLine, emittedColumn, sourceIndex, sourceLine, sourceColumn }; + if (segment.length === 5) { + nameIndex += segment[4]; + mapping.nameIndex = nameIndex; + } + + mappings.push(mapping); + + const mappingsForEmittedLine = this._emittedLineMappings[mapping.emittedLine] || (this._emittedLineMappings[mapping.emittedLine] = []); + mappingsForEmittedLine.push(mapping); + + const mappingsForSource = this._sourceLineMappings[mapping.sourceIndex] || (this._sourceLineMappings[mapping.sourceIndex] = []); + const mappingsForSourceLine = mappingsForSource[mapping.sourceLine] || (mappingsForSource[mapping.sourceLine] = []); + mappingsForSourceLine.push(mapping); + } + else if (match[2]) { + emittedLine++; + emittedColumn = 0; + } + else { + throw new Error(`Unrecognized character '${match[0]}'.`); + } + } + + this.mappings = mappings; + } + + public static getUrl(text: string) { + let match: RegExpExecArray | null; + let lastMatch: RegExpExecArray | undefined; + while (match = sourceMappingURLRegExp.exec(text)) { + lastMatch = match; + } + return lastMatch ? lastMatch[1] : undefined; + } + + public static fromUrl(url: string) { + const match = dataURLRegExp.exec(url); + return match ? new SourceMap(/*mapFile*/ undefined, new Buffer(match[1], "base64").toString("utf8")) : undefined; + } + + public static fromSource(text: string) { + const url = this.getUrl(text); + return url && this.fromUrl(url); + } + + public getMappingsForEmittedLine(emittedLine: number): ReadonlyArray | undefined { + return this._emittedLineMappings[emittedLine]; + } + + public getMappingsForSourceLine(sourceIndex: number, sourceLine: number): ReadonlyArray | undefined { + const mappingsForSource = this._sourceLineMappings[sourceIndex]; + return mappingsForSource && mappingsForSource[sourceLine]; + } + } + + const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + + export function decodeVLQ(text: string) { + const vlq: number[] = []; + let shift = 0; + let value = 0; + for (let i = 0; i < text.length; i++) { + const currentByte = base64Chars.indexOf(text.charAt(i)); + value += (currentByte & 31) << shift; + if ((currentByte & 32) === 0) { + vlq.push(value & 1 ? -(value >>> 1) : value >>> 1); + shift = 0; + value = 0; + } + else { + shift += 5; + } + } + return vlq; + } +} \ No newline at end of file diff --git a/src/harness/events.ts b/src/harness/events.ts index 9443bad9dfebb..684995d4250ab 100644 --- a/src/harness/events.ts +++ b/src/harness/events.ts @@ -10,11 +10,11 @@ namespace events { export interface EventEmitter { on(event: string | symbol, listener: (...args: any[]) => void): this; - once: this["on"]; - addListener: this["on"]; - prependListener: this["on"]; - prependOnceListener: this["on"]; - removeListener: this["on"]; + once(event: string | symbol, listener: (...args: any[]) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; removeAllListeners(event?: string | symbol): this; setMaxListeners(n: number): this; getMaxListeners(): number; diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 415de60fb6053..964662aaa3ea2 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -957,6 +957,10 @@ namespace Harness { } } +if (Harness.IO.tryEnableSourceMapsForHost && /^development$/i.test(Harness.IO.getEnvironmentVariable("NODE_ENV"))) { + Harness.IO.tryEnableSourceMapsForHost(); +} + namespace Harness { export const libFolder = "built/local/"; const tcServicesFileName = ts.combinePaths(libFolder, Utils.getExecutionEnvironment() === Utils.ExecutionEnvironment.Browser ? "typescriptServicesInBrowserTest.js" : "typescriptServices.js"); @@ -1333,7 +1337,7 @@ namespace Harness { options.skipDefaultLibCheck = typeof options.skipDefaultLibCheck === "undefined" ? true : options.skipDefaultLibCheck; if (typeof currentDirectory === "undefined") { - currentDirectory = Harness.IO.getCurrentDirectory(); + currentDirectory = "/.src"; } // Parse settings @@ -1345,56 +1349,44 @@ namespace Harness { } const useCaseSensitiveFileNames = options.useCaseSensitiveFileNames !== undefined ? options.useCaseSensitiveFileNames : Harness.IO.useCaseSensitiveFileNames(); - const programFiles: TestFile[] = inputFiles.slice(); + const programFileNames = inputFiles.map(file => file.unitName); + // 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. if (options.includeBuiltFile) { - const builtFileName = ts.combinePaths(libFolder, options.includeBuiltFile); - const builtFile: TestFile = { - unitName: builtFileName, - content: normalizeLineEndings(IO.readFile(builtFileName), Harness.IO.newLine()), - }; - programFiles.push(builtFile); + programFileNames.push(vpath.combine("/.ts/", options.includeBuiltFile)); } - const fileOutputs: GeneratedFile[] = []; - // Files from tests\lib that are requested by "@libFiles" if (options.libFiles) { for (const fileName of options.libFiles.split(",")) { - const libFileName = "tests/lib/" + fileName; - // Content is undefined here because in createCompilerHost we will create sourceFile for the lib file and cache the result - programFiles.push({ unitName: libFileName, content: undefined }); - } - } - - - const programFileNames = programFiles.map(file => file.unitName); - - const compilerHost = createCompilerHost( - programFiles.concat(otherFiles), - (fileName, code, writeByteOrderMark) => fileOutputs.push({ fileName, code, writeByteOrderMark }), - options.target, - useCaseSensitiveFileNames, - currentDirectory, - options.newLine, - options.libFiles); - - let traceResults: string[]; - if (options.traceResolution) { - traceResults = []; - compilerHost.trace = text => traceResults.push(text); - } - else { - compilerHost.directoryExists = () => true; // This only visibly affects resolution traces, so to save time we always return true where possible - } - const program = ts.createProgram(programFileNames, options, compilerHost); - - const emitResult = program.emit(); - - const errors = ts.getPreEmitDiagnostics(program); - - const result = new CompilerResult(fileOutputs, errors, program, Harness.IO.getCurrentDirectory(), emitResult.sourceMaps, traceResults); + programFileNames.push(vpath.combine("/.lib/", fileName)); + } + } + + const compilation = compiler.compileFiles( + new compiler.CompilerHost( + vfs.VirtualFileSystem.createFromTestFiles( + { useCaseSensitiveFileNames, currentDirectory }, + inputFiles.concat(otherFiles), + { overwrite: true } + ), + options + ), + programFileNames, + options); + + const fileOutputs = compilation.outputs ? compilation.outputs.map(output => ({ + fileName: output.file, + code: utils.removeByteOrderMark(output.text), + writeByteOrderMark: utils.getByteOrderMarkLength(output.text) > 0 + })) : []; + + const traceResults = compilation.traces && compilation.traces.slice(); + const program = compilation.program; + const emitResult = compilation.result; + const errors = compilation.diagnostics; + const result = new CompilerResult(fileOutputs, errors, program, compilation.vfs.currentDirectory, emitResult.sourceMaps, traceResults); return { result, options }; } @@ -1479,14 +1471,6 @@ namespace Harness { return { declInputFiles, declOtherFiles, declResult: output.result }; } - function normalizeLineEndings(text: string, lineEnding: string): string { - let normalized = text.replace(/\r\n?/g, "\n"); - if (lineEnding !== "\n") { - normalized = normalized.replace(/\n/g, lineEnding); - } - return normalized; - } - export function minimalDiagnosticsToString(diagnostics: ReadonlyArray, pretty?: boolean) { const host = { getCanonicalFileName, getCurrentDirectory: () => "", getNewLine: () => Harness.IO.newLine() }; return (pretty ? ts.formatDiagnosticsWithColorAndContext : ts.formatDiagnostics)(diagnostics, host); @@ -1524,7 +1508,7 @@ namespace Harness { function outputErrorText(error: ts.Diagnostic) { const message = ts.flattenDiagnosticMessageText(error.messageText, Harness.IO.newLine()); - const errLines = RunnerBase.removeFullPaths(message) + const errLines = utils.removeTestPathPrefixes(message) .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) @@ -1542,7 +1526,7 @@ namespace Harness { } } - yield [diagnosticSummaryMarker, minimalDiagnosticsToString(diagnostics, pretty) + Harness.IO.newLine() + Harness.IO.newLine(), diagnostics.length]; + yield [diagnosticSummaryMarker, utils.removeTestPathPrefixes(minimalDiagnosticsToString(diagnostics, pretty)) + Harness.IO.newLine() + Harness.IO.newLine(), diagnostics.length]; // Report global errors const globalErrors = diagnostics.filter(err => !err.file); @@ -1557,7 +1541,7 @@ namespace Harness { // Filter down to the errors in the file const fileErrors = diagnostics.filter(e => { const errFn = e.file; - return errFn && errFn.fileName === inputFile.unitName; + return errFn && utils.removeTestPathPrefixes(errFn.fileName) === utils.removeTestPathPrefixes(inputFile.unitName); }); @@ -1774,7 +1758,7 @@ namespace Harness { } typeLines += "\r\n"; } - yield [checkDuplicatedFileName(unitName, dupeCase), typeLines]; + yield [checkDuplicatedFileName(unitName, dupeCase), utils.removeTestPathPrefixes(typeLines)]; } } } @@ -1866,8 +1850,8 @@ namespace Harness { } function fileOutput(file: GeneratedFile, harnessSettings: Harness.TestCaseParser.CompilerSettings): string { - const fileName = harnessSettings.fullEmitPaths ? file.fileName : ts.getBaseFileName(file.fileName); - return "//// [" + fileName + "]\r\n" + getByteOrderMarkText(file) + file.code; + const fileName = harnessSettings.fullEmitPaths ? utils.removeTestPathPrefixes(file.fileName) : ts.getBaseFileName(file.fileName); + return "//// [" + fileName + "]\r\n" + getByteOrderMarkText(file) + utils.removeTestPathPrefixes(file.code); } export function collateOutputs(outputFiles: Harness.Compiler.GeneratedFile[]): string { @@ -2325,7 +2309,8 @@ namespace Harness { } export function isBuiltFile(filePath: string): boolean { - return filePath.indexOf(Harness.libFolder) === 0; + return filePath.indexOf(Harness.libFolder) === 0 || + filePath.indexOf("/.ts/") === 0; } export function getDefaultLibraryFile(io: Harness.IO): Harness.Compiler.TestFile { diff --git a/src/harness/runner.ts b/src/harness/runner.ts index b30fd1a44a594..eb0ed4e614b2e 100644 --- a/src/harness/runner.ts +++ b/src/harness/runner.ts @@ -66,10 +66,6 @@ function createRunner(kind: TestRunnerKind): RunnerBase { ts.Debug.fail(`Unknown runner kind ${kind}`); } -if (Harness.IO.tryEnableSourceMapsForHost && /^development$/i.test(Harness.IO.getEnvironmentVariable("NODE_ENV"))) { - Harness.IO.tryEnableSourceMapsForHost(); -} - // users can define tests to run in mytest.config that will override cmd line args, otherwise use cmd line args (test.config), otherwise no options const mytestconfigFileName = "mytest.config"; diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index dfcc29fa1b734..26f60116009f4 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -82,6 +82,16 @@ "../services/codefixes/disableJsDiagnostics.ts", "harness.ts", + + "utils.ts", + "events.ts", + "collections.ts", + "documents.ts", + "vpath.ts", + "vfs.ts", + "compiler.ts", + + "virtualFileSystemWithWatch.ts", "sourceMapRecorder.ts", "harnessLanguageService.ts", "fourslash.ts", @@ -98,11 +108,6 @@ "./parallel/host.ts", "./parallel/worker.ts", "runner.ts", - "collections.ts", - "vpath.ts", - "events.ts", - "vfs.ts", - "virtualFileSystemWithWatch.ts", "../server/protocol.ts", "../server/session.ts", "../server/client.ts", diff --git a/src/harness/utils.ts b/src/harness/utils.ts new file mode 100644 index 0000000000000..79ab489304e5b --- /dev/null +++ b/src/harness/utils.ts @@ -0,0 +1,51 @@ +namespace utils { + export function getByteOrderMarkLength(text: string) { + if (text.length >= 2) { + const ch0 = text.charCodeAt(0); + const ch1 = text.charCodeAt(1); + if ((ch0 === 0xff && ch1 === 0xfe) || + (ch0 === 0xfe && ch1 === 0xff)) { + return 2; + } + if (text.length >= 3 && ch0 === 0xef && ch1 === 0xbb && text.charCodeAt(2) === 0xbf) { + return 3; + } + } + return 0; + } + + export function removeByteOrderMark(text: string) { + const length = getByteOrderMarkLength(text); + return length ? text.slice(length) : text; + } + + const leadingCommentRegExp = /^(\s*\/\*[^]*?\*\/\s*|\s*\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)+/; + const trailingCommentRegExp = /(\s*\/\*[^]*?\*\/\s*|\s*\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)+$/; + const leadingAndTrailingCommentRegExp = /^(\s*\/\*[^]*?\*\/\s*|\s*\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)+|(\s*\/\*[^]*?\*\/\s*|\s*\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)+$/g; + const allCommentRegExp = /(['"])(?:(?!\1).|\\[^])*\1|(\/\*[^]*?\*\/|\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)/g; + + export const enum CommentRemoval { + leading, + trailing, + leadingAndTrailing, + all + } + + export function removeComments(text: string, removal: CommentRemoval) { + switch (removal) { + case CommentRemoval.leading: + return text.replace(leadingCommentRegExp, ""); + case CommentRemoval.trailing: + return text.replace(trailingCommentRegExp, ""); + case CommentRemoval.leadingAndTrailing: + return text.replace(leadingAndTrailingCommentRegExp, ""); + case CommentRemoval.all: + return text.replace(allCommentRegExp, (match, quote) => quote ? match : ""); + } + } + + const testPathPrefixRegExp = /\/\.(ts|lib|src)\//g; + export function removeTestPathPrefixes(text: string) { + return text !== undefined ? text.replace(testPathPrefixRegExp, "") : undefined; + } +} \ No newline at end of file diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index 9dd7295db619a..238cb65e05943 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -7,7 +7,6 @@ namespace vfs { import KeyedCollection = collections.KeyedCollection; import Metadata = collections.Metadata; import EventEmitter = events.EventEmitter; - import IO = Harness.IO; export interface PathMappings { [path: string]: string; @@ -58,7 +57,7 @@ namespace vfs { return new RegExp(pattern, ignoreCase ? "i" : ""); } - export function createResolver(io: IO, map?: PathMappings): FileSystemResolver { + export function createResolver(io: Harness.IO, map?: PathMappings): FileSystemResolver { const mapper = createMapper(!io.useCaseSensitiveFileNames(), map); return { getEntries(dir) { @@ -126,6 +125,7 @@ namespace vfs { private _watchedDirectories: KeyedCollection | undefined; private _stringComparer: ts.Comparer | undefined; private _pathComparer: ts.Comparer | undefined; + private _metadata: Metadata; private _onRootFileSystemChange: (path: string, change: FileSystemChange) => void; constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean) { @@ -154,6 +154,13 @@ namespace vfs { return this._shadowRoot; } + /** + * Gets metadata about this file system. + */ + public get metadata(): Metadata { + return this._metadata || (this._metadata = new Metadata(this.shadowRoot ? this.shadowRoot.metadata : undefined)); + } + /** * Gets a value indicating whether to use case sensitive file names. */ @@ -183,28 +190,29 @@ namespace vfs { } /** - * Gets a virtual file system with the following entries: + * Gets a virtual file system with the following directories: * * | path | physical/virtual | * |:-------|:----------------------| * | /.ts | physical: built/local | * | /.lib | physical: tests/lib | - * | /.test | virtual | + * | /.src | virtual | */ - public static getBuiltLocal(useCaseSensitiveFileNames: boolean = IO.useCaseSensitiveFileNames()): VirtualFileSystem { + public static getBuiltLocal(useCaseSensitiveFileNames: boolean = Harness.IO.useCaseSensitiveFileNames()): VirtualFileSystem { let vfs = useCaseSensitiveFileNames ? this._builtLocalCS : this._builtLocalCI; if (!vfs) { vfs = this._builtLocal; if (!vfs) { - const resolver = createResolver(IO, { + const resolver = createResolver(Harness.IO, { "/.ts": __dirname, "/.lib": vpath.resolve(__dirname, "../../tests/lib") }); - vfs = new VirtualFileSystem("/", IO.useCaseSensitiveFileNames()); + vfs = new VirtualFileSystem("/", Harness.IO.useCaseSensitiveFileNames()); + vfs.metadata.set("defaultLibLocation", "/.ts"); vfs.addDirectory("/.ts", resolver); vfs.addDirectory("/.lib", resolver); - vfs.addDirectory("/.test"); - vfs.changeDirectory("/.test"); + vfs.addDirectory("/.src"); + vfs.changeDirectory("/.src"); vfs.makeReadOnly(); this._builtLocal = vfs; } @@ -220,6 +228,34 @@ namespace vfs { return vfs; } + public static createFromOptions(options: { useCaseSensitiveFileNames?: boolean, currentDirectory?: string }) { + const vfs = this.getBuiltLocal(options.useCaseSensitiveFileNames).shadow(); + if (options.currentDirectory) { + vfs.addDirectory(options.currentDirectory); + vfs.changeDirectory(options.currentDirectory); + } + return vfs; + } + + public static createFromTestFiles(options: { useCaseSensitiveFileNames?: boolean, currentDirectory?: string }, documents: Harness.Compiler.TestFile[], fileOptions?: { overwrite?: boolean }) { + const vfs = this.createFromOptions(options); + for (const document of documents) { + const file = vfs.addFile(document.unitName, document.content, fileOptions)!; + assert.isDefined(file, `Failed to add file: '${document.unitName}'`); + file.metadata.set("document", document); + // Add symlinks + const symlink = document.fileOptions && document.fileOptions.symlink; + if (file && symlink) { + for (const link of symlink.split(",")) { + const symlink = vfs.addSymlink(vpath.resolve(vfs.currentDirectory, link.trim()), file)!; + assert.isDefined(symlink, `Failed to symlink: '${link}'`); + symlink.metadata.set("document", document); + } + } + } + return vfs; + } + /** * Changes the current directory to the supplied path. */ @@ -529,8 +565,27 @@ namespace vfs { } export interface VirtualFileSystemEntry { + // #region Event "fileSystemChange" on(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; - emit(event: "fileSystemChange", path: string, change: FileSystemChange): boolean; + once(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + addListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + removeListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + prependListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + prependOnceListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + emit(name: "fileSystemChange", path: string, change: FileSystemChange): boolean; + // #endregion Event "fileSystemChange" + } + + export interface VirtualFileSystemEntry { + // #region Untyped events + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + // #endregion Untyped events } export abstract class VirtualFileSystemEntry extends VirtualFileSystemObject { @@ -631,10 +686,39 @@ namespace vfs { } export interface VirtualDirectory { + // #region Event "fileSystemChange" on(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + once(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + addListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + removeListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + prependListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + prependOnceListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + emit(name: "fileSystemChange", path: string, change: FileSystemChange): boolean; + // #endregion Event "fileSystemChange" + } + + export interface VirtualDirectory { + // #region Event "childAdded" | "childRemoved" on(event: "childAdded" | "childRemoved", listener: (child: VirtualEntry) => void): this; - emit(event: "fileSystemChange", path: string, change: FileSystemChange): boolean; - emit(event: "childAdded" | "childRemoved", child: VirtualEntry): boolean; + once(event: "childAdded" | "childRemoved", listener: (child: VirtualEntry) => void): this; + addListener(event: "childAdded" | "childRemoved", listener: (child: VirtualEntry) => void): this; + removeListener(event: "childAdded" | "childRemoved", listener: (child: VirtualEntry) => void): this; + prependListener(event: "childAdded" | "childRemoved", listener: (child: VirtualEntry) => void): this; + prependOnceListener(event: "childAdded" | "childRemoved", listener: (child: VirtualEntry) => void): this; + emit(name: "childAdded" | "childRemoved", child: VirtualEntry): boolean; + // #endregion Event "childAdded" | "childRemoved" + } + + export interface VirtualDirectory { + // #region Untyped events + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + // #endregion Untyped events } export class VirtualDirectory extends VirtualFileSystemEntry { @@ -1277,10 +1361,39 @@ namespace vfs { } export interface VirtualFile { + // #region Event "fileSystemChange" on(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + once(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + addListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + removeListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + prependListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + prependOnceListener(event: "fileSystemChange", listener: (path: string, change: FileSystemChange) => void): this; + emit(name: "fileSystemChange", path: string, change: FileSystemChange): boolean; + // #endregion Event "fileSystemChange" + } + + export interface VirtualFile { + // #region Event "contentChanged" on(event: "contentChanged", listener: (entry: VirtualFile) => void): this; - emit(event: "fileSystemChange", path: string, change: FileSystemChange): boolean; - emit(event: "contentChanged", entry: VirtualFile): boolean; + once(event: "contentChanged", listener: (entry: VirtualFile) => void): this; + addListener(event: "contentChanged", listener: (entry: VirtualFile) => void): this; + removeListener(event: "contentChanged", listener: (entry: VirtualFile) => void): this; + prependListener(event: "contentChanged", listener: (entry: VirtualFile) => void): this; + prependOnceListener(event: "contentChanged", listener: (entry: VirtualFile) => void): this; + emit(name: "contentChanged", entry: VirtualFile): boolean; + // #endregion Event "contentChanged" + } + + export interface VirtualFile { + // #region Untyped events + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + emit(event: string | symbol, ...args: any[]): boolean; + // #endregion Untyped events } export class VirtualFile extends VirtualFileSystemEntry { diff --git a/src/harness/vpath.ts b/src/harness/vpath.ts index fe6a6b36a12e3..7a7669a4e1029 100644 --- a/src/harness/vpath.ts +++ b/src/harness/vpath.ts @@ -134,8 +134,6 @@ namespace vpath { * Compare two paths. */ export function compare(a: string, b: string, ignoreCase: boolean) { - if (!isAbsolute(a)) throw new Error("Path not absolute"); - if (!isAbsolute(b)) throw new Error("Path not absolute"); if (a === b) return 0; a = removeTrailingSeparator(a); b = removeTrailingSeparator(b); @@ -269,4 +267,38 @@ namespace vpath { const match = extRegExp.exec(path); return match ? match[0] : ""; } + + export function changeExtension(path: string, ext: string): string; + export function changeExtension(path: string, ext: string, extensions: string | string[], ignoreCase: boolean): string; + export function changeExtension(path: string, ext: string, extensions?: string | string[], ignoreCase?: boolean) { + const pathext = extensions ? extname(path, extensions, ignoreCase) : extname(path); + return pathext ? path.slice(0, path.length - pathext.length) + (ext.startsWith(".") ? ext : "." + ext) : path; + } + + export function isTypeScript(path: string) { + return path.endsWith(".ts") + || path.endsWith(".tsx"); + } + + export function isJavaScript(path: string) { + return path.endsWith(".js") + || path.endsWith(".jsx"); + } + + export function isDeclaration(path: string) { + return path.endsWith(".d.ts"); + } + + export function isSourceMap(path: string) { + return path.endsWith(".map"); + } + + export function isJson(path: string) { + return path.endsWith(".json"); + } + + export function isDefaultLibrary(path: string) { + return isDeclaration(path) + && basename(path).startsWith("lib."); + } } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1.errors.txt b/tests/baselines/reference/ES5For-of1.errors.txt deleted file mode 100644 index 16222725b3d64..0000000000000 --- a/tests/baselines/reference/ES5For-of1.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts(2,5): error TS2304: Cannot find name 'console'. - - -==== tests/cases/conformance/statements/for-ofStatements/ES5For-of1.ts (1 errors) ==== - for (var v of ['a', 'b', 'c']) { - console.log(v); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of1.symbols b/tests/baselines/reference/ES5For-of1.symbols index a80c69cd2cfc4..ded21109f3837 100644 --- a/tests/baselines/reference/ES5For-of1.symbols +++ b/tests/baselines/reference/ES5For-of1.symbols @@ -3,5 +3,8 @@ for (var v of ['a', 'b', 'c']) { >v : Symbol(v, Decl(ES5For-of1.ts, 0, 8)) console.log(v); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >v : Symbol(v, Decl(ES5For-of1.ts, 0, 8)) } diff --git a/tests/baselines/reference/ES5For-of1.types b/tests/baselines/reference/ES5For-of1.types index 4f9117740fb8c..cc6c94fcb5741 100644 --- a/tests/baselines/reference/ES5For-of1.types +++ b/tests/baselines/reference/ES5For-of1.types @@ -7,9 +7,9 @@ for (var v of ['a', 'b', 'c']) { >'c' : "c" console.log(v); ->console.log(v) : any ->console.log : any ->console : any ->log : any +>console.log(v) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >v : string } diff --git a/tests/baselines/reference/ES5For-of22.errors.txt b/tests/baselines/reference/ES5For-of22.errors.txt deleted file mode 100644 index 914be13c63cb4..0000000000000 --- a/tests/baselines/reference/ES5For-of22.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts(3,5): error TS2304: Cannot find name 'console'. - - -==== tests/cases/conformance/statements/for-ofStatements/ES5For-of22.ts (1 errors) ==== - for (var x of [1, 2, 3]) { - let _a = 0; - console.log(x); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of22.symbols b/tests/baselines/reference/ES5For-of22.symbols index 6511d8c9a8b65..0aacdd6ca5dd6 100644 --- a/tests/baselines/reference/ES5For-of22.symbols +++ b/tests/baselines/reference/ES5For-of22.symbols @@ -6,5 +6,8 @@ for (var x of [1, 2, 3]) { >_a : Symbol(_a, Decl(ES5For-of22.ts, 1, 7)) console.log(x); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(ES5For-of22.ts, 0, 8)) } diff --git a/tests/baselines/reference/ES5For-of22.types b/tests/baselines/reference/ES5For-of22.types index ec99c310bf7ff..c42385513792c 100644 --- a/tests/baselines/reference/ES5For-of22.types +++ b/tests/baselines/reference/ES5For-of22.types @@ -11,9 +11,9 @@ for (var x of [1, 2, 3]) { >0 : 0 console.log(x); ->console.log(x) : any ->console.log : any ->console : any ->log : any +>console.log(x) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >x : number } diff --git a/tests/baselines/reference/ES5For-of23.errors.txt b/tests/baselines/reference/ES5For-of23.errors.txt deleted file mode 100644 index cbc043e32d224..0000000000000 --- a/tests/baselines/reference/ES5For-of23.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts(3,5): error TS2304: Cannot find name 'console'. - - -==== tests/cases/conformance/statements/for-ofStatements/ES5For-of23.ts (1 errors) ==== - for (var x of [1, 2, 3]) { - var _a = 0; - console.log(x); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of23.symbols b/tests/baselines/reference/ES5For-of23.symbols index 7b030d4e1e34a..625b23dc7a88e 100644 --- a/tests/baselines/reference/ES5For-of23.symbols +++ b/tests/baselines/reference/ES5For-of23.symbols @@ -6,5 +6,8 @@ for (var x of [1, 2, 3]) { >_a : Symbol(_a, Decl(ES5For-of23.ts, 1, 7)) console.log(x); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(ES5For-of23.ts, 0, 8)) } diff --git a/tests/baselines/reference/ES5For-of23.types b/tests/baselines/reference/ES5For-of23.types index c519e1c6ee294..4f90e492aac07 100644 --- a/tests/baselines/reference/ES5For-of23.types +++ b/tests/baselines/reference/ES5For-of23.types @@ -11,9 +11,9 @@ for (var x of [1, 2, 3]) { >0 : 0 console.log(x); ->console.log(x) : any ->console.log : any ->console : any ->log : any +>console.log(x) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >x : number } diff --git a/tests/baselines/reference/ES5For-of33.errors.txt b/tests/baselines/reference/ES5For-of33.errors.txt deleted file mode 100644 index 02ba889c542fb..0000000000000 --- a/tests/baselines/reference/ES5For-of33.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts(2,5): error TS2304: Cannot find name 'console'. - - -==== tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts (1 errors) ==== - for (var v of ['a', 'b', 'c']) { - console.log(v); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of33.symbols b/tests/baselines/reference/ES5For-of33.symbols index 0d3008a553365..642afdc536892 100644 --- a/tests/baselines/reference/ES5For-of33.symbols +++ b/tests/baselines/reference/ES5For-of33.symbols @@ -3,5 +3,8 @@ for (var v of ['a', 'b', 'c']) { >v : Symbol(v, Decl(ES5For-of33.ts, 0, 8)) console.log(v); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >v : Symbol(v, Decl(ES5For-of33.ts, 0, 8)) } diff --git a/tests/baselines/reference/ES5For-of33.types b/tests/baselines/reference/ES5For-of33.types index 2bcd7b9fc352d..f7bfedb69098c 100644 --- a/tests/baselines/reference/ES5For-of33.types +++ b/tests/baselines/reference/ES5For-of33.types @@ -7,9 +7,9 @@ for (var v of ['a', 'b', 'c']) { >'c' : "c" console.log(v); ->console.log(v) : any ->console.log : any ->console : any ->log : any +>console.log(v) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >v : string } diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.symbols b/tests/baselines/reference/anyAssignabilityInInheritance.symbols index 56bb982fea136..d0189b2c6aa9e 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.symbols +++ b/tests/baselines/reference/anyAssignabilityInInheritance.symbols @@ -56,8 +56,8 @@ var r3 = foo3(a); // any declare function foo5(x: Date): Date; >foo5 : Symbol(foo5, Decl(anyAssignabilityInInheritance.ts, 19, 17), Decl(anyAssignabilityInInheritance.ts, 21, 37)) >x : Symbol(x, Decl(anyAssignabilityInInheritance.ts, 21, 22)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) declare function foo5(x: any): any; >foo5 : Symbol(foo5, Decl(anyAssignabilityInInheritance.ts, 19, 17), Decl(anyAssignabilityInInheritance.ts, 21, 37)) diff --git a/tests/baselines/reference/anyAssignableToEveryType.symbols b/tests/baselines/reference/anyAssignableToEveryType.symbols index 4995a24a5c247..7abc48548b820 100644 --- a/tests/baselines/reference/anyAssignableToEveryType.symbols +++ b/tests/baselines/reference/anyAssignableToEveryType.symbols @@ -44,7 +44,7 @@ var d: boolean = a; var e: Date = a; >e : Symbol(e, Decl(anyAssignableToEveryType.ts, 17, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(anyAssignableToEveryType.ts, 0, 3)) var f: any = a; @@ -122,7 +122,7 @@ function foo(x: T, y: U, z: V) { >T : Symbol(T, Decl(anyAssignableToEveryType.ts, 34, 13)) >U : Symbol(U, Decl(anyAssignableToEveryType.ts, 34, 15)) >V : Symbol(V, Decl(anyAssignableToEveryType.ts, 34, 32)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(anyAssignableToEveryType.ts, 34, 49)) >T : Symbol(T, Decl(anyAssignableToEveryType.ts, 34, 13)) >y : Symbol(y, Decl(anyAssignableToEveryType.ts, 34, 54)) diff --git a/tests/baselines/reference/anyAssignableToEveryType2.symbols b/tests/baselines/reference/anyAssignableToEveryType2.symbols index 12d380aa36838..75c6c1e170a8f 100644 --- a/tests/baselines/reference/anyAssignableToEveryType2.symbols +++ b/tests/baselines/reference/anyAssignableToEveryType2.symbols @@ -50,7 +50,7 @@ interface I5 { [x: string]: Date; >x : Symbol(x, Decl(anyAssignableToEveryType2.ts, 27, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: any; >foo : Symbol(I5.foo, Decl(anyAssignableToEveryType2.ts, 27, 22)) diff --git a/tests/baselines/reference/argumentsObjectIterator01_ES6.symbols b/tests/baselines/reference/argumentsObjectIterator01_ES6.symbols index aaa7431408bf9..d2b53d381e4fb 100644 --- a/tests/baselines/reference/argumentsObjectIterator01_ES6.symbols +++ b/tests/baselines/reference/argumentsObjectIterator01_ES6.symbols @@ -13,9 +13,9 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe >arguments : Symbol(arguments) result.push(arg + arg); ->result.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>result.push : Symbol(Array.push, Decl(lib.es6.d.ts, --, --)) >result : Symbol(result, Decl(argumentsObjectIterator01_ES6.ts, 1, 7)) ->push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es6.d.ts, --, --)) >arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 2, 12)) >arg : Symbol(arg, Decl(argumentsObjectIterator01_ES6.ts, 2, 12)) } diff --git a/tests/baselines/reference/argumentsObjectIterator02_ES6.symbols b/tests/baselines/reference/argumentsObjectIterator02_ES6.symbols index 64b82088e1a31..9582ff46bcfa4 100644 --- a/tests/baselines/reference/argumentsObjectIterator02_ES6.symbols +++ b/tests/baselines/reference/argumentsObjectIterator02_ES6.symbols @@ -8,9 +8,9 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe let blah = arguments[Symbol.iterator]; >blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 1, 7)) >arguments : Symbol(arguments) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) let result = []; >result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 3, 7)) @@ -20,9 +20,9 @@ function doubleAndReturnAsArray(x: number, y: number, z: number): [number, numbe >blah : Symbol(blah, Decl(argumentsObjectIterator02_ES6.ts, 1, 7)) result.push(arg + arg); ->result.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>result.push : Symbol(Array.push, Decl(lib.es6.d.ts, --, --)) >result : Symbol(result, Decl(argumentsObjectIterator02_ES6.ts, 3, 7)) ->push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es6.d.ts, --, --)) >arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 4, 12)) >arg : Symbol(arg, Decl(argumentsObjectIterator02_ES6.ts, 4, 12)) } diff --git a/tests/baselines/reference/arrayLiterals2ES6.symbols b/tests/baselines/reference/arrayLiterals2ES6.symbols index da256ba22388e..d11c61e53780b 100644 --- a/tests/baselines/reference/arrayLiterals2ES6.symbols +++ b/tests/baselines/reference/arrayLiterals2ES6.symbols @@ -72,14 +72,14 @@ var temp2: [number[], string[]] = [[1, 2, 3], ["hello", "string"]]; interface myArray extends Array { } >myArray : Symbol(myArray, Decl(arrayLiterals2ES6.ts, 40, 67)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) interface myArray2 extends Array { } >myArray2 : Symbol(myArray2, Decl(arrayLiterals2ES6.ts, 42, 43)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->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) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) var d0 = [1, true, ...temp, ]; // has type (string|number|boolean)[] >d0 : Symbol(d0, Decl(arrayLiterals2ES6.ts, 44, 3)) diff --git a/tests/baselines/reference/arrowFunctionContexts.errors.txt b/tests/baselines/reference/arrowFunctionContexts.errors.txt index df158dec25e6e..b0d5d1dfc2542 100644 --- a/tests/baselines/reference/arrowFunctionContexts.errors.txt +++ b/tests/baselines/reference/arrowFunctionContexts.errors.txt @@ -1,22 +1,16 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(2,1): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(2,7): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(18,1): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(30,9): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(31,16): error TS2332: 'this' cannot be referenced in current location. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(43,5): error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(43,11): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(59,5): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(71,13): error TS2322: Type '() => number' is not assignable to type 'E'. tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,20): error TS2332: 'this' cannot be referenced in current location. -==== tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts (10 errors) ==== +==== tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts (6 errors) ==== // Arrow function used in with statement with (window) { ~~~~~~~~~~~~~ !!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. var p = () => this; } @@ -33,8 +27,6 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,20): e // Arrow function as function argument window.setTimeout(() => null, 100); - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. // Arrow function as value in array literal @@ -66,8 +58,6 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,20): e with (window) { ~~~~~~~~~~~~~ !!! error TS2410: The 'with' statement is not supported. All symbols in a 'with' block will have type 'any'. - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. var p = () => this; } @@ -84,8 +74,6 @@ tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts(72,20): e // Arrow function as function argument window.setTimeout(() => null, 100); - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. // Arrow function as value in array literal diff --git a/tests/baselines/reference/arrowFunctionContexts.symbols b/tests/baselines/reference/arrowFunctionContexts.symbols index 44b9aaedec476..b93929dee59e2 100644 --- a/tests/baselines/reference/arrowFunctionContexts.symbols +++ b/tests/baselines/reference/arrowFunctionContexts.symbols @@ -1,6 +1,8 @@ === tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts === // Arrow function used in with statement with (window) { +>window : Symbol(window, Decl(lib.d.ts, --, --)) + var p = () => this; } @@ -25,6 +27,9 @@ class Derived extends Base { // Arrow function as function argument window.setTimeout(() => null, 100); +>window.setTimeout : Symbol(WindowTimers.setTimeout, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) +>setTimeout : Symbol(WindowTimers.setTimeout, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Arrow function as value in array literal @@ -77,6 +82,8 @@ module M2 { // Arrow function used in with statement with (window) { +>window : Symbol(window, Decl(lib.d.ts, --, --)) + var p = () => this; } @@ -101,6 +108,9 @@ module M2 { // Arrow function as function argument window.setTimeout(() => null, 100); +>window.setTimeout : Symbol(WindowTimers.setTimeout, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) +>setTimeout : Symbol(WindowTimers.setTimeout, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Arrow function as value in array literal diff --git a/tests/baselines/reference/arrowFunctionContexts.types b/tests/baselines/reference/arrowFunctionContexts.types index 80c310a8cd4fb..bd40854d948fc 100644 --- a/tests/baselines/reference/arrowFunctionContexts.types +++ b/tests/baselines/reference/arrowFunctionContexts.types @@ -1,7 +1,7 @@ === tests/cases/conformance/expressions/functions/arrowFunctionContexts.ts === // Arrow function used in with statement with (window) { ->window : any +>window : Window var p = () => this; >p : any @@ -32,10 +32,10 @@ class Derived extends Base { // Arrow function as function argument window.setTimeout(() => null, 100); ->window.setTimeout(() => null, 100) : any ->window.setTimeout : any ->window : any ->setTimeout : any +>window.setTimeout(() => null, 100) : number +>window.setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; } +>window : Window +>setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; } >() => null : () => any >null : null >100 : 100 @@ -104,7 +104,7 @@ module M2 { // Arrow function used in with statement with (window) { ->window : any +>window : Window var p = () => this; >p : any @@ -135,10 +135,10 @@ module M2 { // Arrow function as function argument window.setTimeout(() => null, 100); ->window.setTimeout(() => null, 100) : any ->window.setTimeout : any ->window : any ->setTimeout : any +>window.setTimeout(() => null, 100) : number +>window.setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; } +>window : Window +>setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; } >() => null : () => any >null : null >100 : 100 diff --git a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols index 534f9cc1ea0ff..e435aae68e07a 100644 --- a/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols +++ b/tests/baselines/reference/arrowFunctionWithObjectLiteralBody6.symbols @@ -1,13 +1,13 @@ === tests/cases/compiler/arrowFunctionWithObjectLiteralBody6.ts === var a = () => { name: "foo", message: "bar" }; >a : Symbol(a, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 3)) ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 22)) >message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 0, 35)) var b = () => ({ name: "foo", message: "bar" }); >b : Symbol(b, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 3)) ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 23)) >message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 2, 36)) @@ -18,7 +18,7 @@ var c = () => ({ name: "foo", message: "bar" }); var d = () => ((({ name: "foo", message: "bar" }))); >d : Symbol(d, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 3)) ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >name : Symbol(name, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 25)) >message : Symbol(message, Decl(arrowFunctionWithObjectLiteralBody6.ts, 6, 38)) diff --git a/tests/baselines/reference/asOperator1.symbols b/tests/baselines/reference/asOperator1.symbols index 83813d26981e1..4fa95489ea9fe 100644 --- a/tests/baselines/reference/asOperator1.symbols +++ b/tests/baselines/reference/asOperator1.symbols @@ -13,7 +13,7 @@ var y = (null as string).length; var z = Date as any as string; >z : Symbol(z, Decl(asOperator1.ts, 3, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Should parse as a union type, not a bitwise 'or' of (32 as number) and 'string' var j = 32 as number|string; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols b/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols index de0a5dc7b28ed..341ded501dcdd 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.symbols @@ -189,8 +189,8 @@ var a18: { (a: Date): Date; >a : Symbol(a, Decl(assignmentCompatWithCallSignatures3.ts, 40, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }): any[]; } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols index 0e3b0b383328c..7e7d1c96476d0 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.symbols @@ -189,8 +189,8 @@ var a18: { new (a: Date): Date; >a : Symbol(a, Decl(assignmentCompatWithConstructSignatures3.ts, 40, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }): any[]; } diff --git a/tests/baselines/reference/asyncAliasReturnType_es6.symbols b/tests/baselines/reference/asyncAliasReturnType_es6.symbols index c9c279dcc4137..775a80846f952 100644 --- a/tests/baselines/reference/asyncAliasReturnType_es6.symbols +++ b/tests/baselines/reference/asyncAliasReturnType_es6.symbols @@ -2,7 +2,7 @@ type PromiseAlias = Promise; >PromiseAlias : Symbol(PromiseAlias, Decl(asyncAliasReturnType_es6.ts, 0, 0)) >T : Symbol(T, Decl(asyncAliasReturnType_es6.ts, 0, 18)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(asyncAliasReturnType_es6.ts, 0, 18)) async function f(): PromiseAlias { diff --git a/tests/baselines/reference/asyncArrowFunction10_es6.symbols b/tests/baselines/reference/asyncArrowFunction10_es6.symbols index 7962e8328bc88..efdfdac1819c4 100644 --- a/tests/baselines/reference/asyncArrowFunction10_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunction10_es6.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction10_es6.ts === var foo = async (): Promise => { >foo : Symbol(foo, Decl(asyncArrowFunction10_es6.ts, 0, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) // Legal to use 'await' in a type context. var v: await; diff --git a/tests/baselines/reference/asyncArrowFunction1_es6.symbols b/tests/baselines/reference/asyncArrowFunction1_es6.symbols index 81cc2d2959357..17d4cb12bcb2b 100644 --- a/tests/baselines/reference/asyncArrowFunction1_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunction1_es6.symbols @@ -1,6 +1,6 @@ === tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction1_es6.ts === var foo = async (): Promise => { >foo : Symbol(foo, Decl(asyncArrowFunction1_es6.ts, 0, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) }; diff --git a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt index b3cb60c95ca4a..3c27076ab6514 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,18): error TS2304: Cannot find name 'await'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,24): error TS1005: ',' expected. -tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es6.d.ts 5438:12, but here has type 'void'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,33): error TS1005: '=' expected. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,40): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es6.d.ts 5438:12, but here has type 'void'. ~ !!! error TS1005: '=' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es6.symbols b/tests/baselines/reference/asyncArrowFunction5_es6.symbols index 44827a41f9b5e..39783cd369861 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunction5_es6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts === var foo = async (await): Promise => { >foo : Symbol(foo, Decl(asyncArrowFunction5_es6.ts, 0, 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, --, --), Decl(asyncArrowFunction5_es6.ts, 0, 24)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(asyncArrowFunction5_es6.ts, 0, 24)) } diff --git a/tests/baselines/reference/asyncArrowFunction6_es6.symbols b/tests/baselines/reference/asyncArrowFunction6_es6.symbols index e3fa9a191f006..b7ba4d6d32e71 100644 --- a/tests/baselines/reference/asyncArrowFunction6_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunction6_es6.symbols @@ -2,5 +2,5 @@ var foo = async (a = await): Promise => { >foo : Symbol(foo, Decl(asyncArrowFunction6_es6.ts, 0, 3)) >a : Symbol(a, Decl(asyncArrowFunction6_es6.ts, 0, 17)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/asyncArrowFunction7_es6.symbols b/tests/baselines/reference/asyncArrowFunction7_es6.symbols index c2d9d8404da3d..5884d07b14262 100644 --- a/tests/baselines/reference/asyncArrowFunction7_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunction7_es6.symbols @@ -1,12 +1,12 @@ === tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction7_es6.ts === var bar = async (): Promise => { >bar : Symbol(bar, Decl(asyncArrowFunction7_es6.ts, 0, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) // 'await' here is an identifier, and not an await expression. var foo = async (a = await): Promise => { >foo : Symbol(foo, Decl(asyncArrowFunction7_es6.ts, 2, 5)) >a : Symbol(a, Decl(asyncArrowFunction7_es6.ts, 2, 19)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } diff --git a/tests/baselines/reference/asyncArrowFunction8_es6.symbols b/tests/baselines/reference/asyncArrowFunction8_es6.symbols index 47117f2c61c7e..572783c310762 100644 --- a/tests/baselines/reference/asyncArrowFunction8_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunction8_es6.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction8_es6.ts === var foo = async (): Promise => { >foo : Symbol(foo, Decl(asyncArrowFunction8_es6.ts, 0, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) var v = { [await]: foo } >v : Symbol(v, Decl(asyncArrowFunction8_es6.ts, 1, 5)) diff --git a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt index 8d974d75dd330..b717aab314c9c 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,11): error TS2304: Cannot find name 'async'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,18): error TS2304: Cannot find name 'a'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,37): error TS1005: ',' expected. -tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es6.d.ts 5438:12, but here has type 'void'. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,46): error TS1005: '=' expected. tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,53): error TS1109: Expression expected. @@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts( ~ !!! error TS1005: ',' expected. ~~~~~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es6.d.ts 5438:12, but here has type 'void'. ~ !!! error TS1005: '=' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es6.symbols b/tests/baselines/reference/asyncArrowFunction9_es6.symbols index 6d0506402bb39..7568151c758ea 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunction9_es6.symbols @@ -3,5 +3,5 @@ var foo = async (a = await => await): Promise => { >foo : Symbol(foo, Decl(asyncArrowFunction9_es6.ts, 0, 3)) >await : Symbol(await, Decl(asyncArrowFunction9_es6.ts, 0, 20)) >await : Symbol(await, Decl(asyncArrowFunction9_es6.ts, 0, 20)) ->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, --, --), Decl(asyncArrowFunction9_es6.ts, 0, 37)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(asyncArrowFunction9_es6.ts, 0, 37)) } diff --git a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.symbols b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.symbols index 4b312fd464633..14b989dda6174 100644 --- a/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.symbols +++ b/tests/baselines/reference/asyncArrowFunctionCapturesArguments_es6.symbols @@ -10,9 +10,9 @@ class C { var fn = async () => await other.apply(this, arguments); >fn : Symbol(fn, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 3, 9)) ->other.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>other.apply : Symbol(Function.apply, Decl(lib.es6.d.ts, --, --)) >other : Symbol(other, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 1, 13)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(Function.apply, Decl(lib.es6.d.ts, --, --)) >this : Symbol(C, Decl(asyncArrowFunctionCapturesArguments_es6.ts, 0, 0)) >arguments : Symbol(arguments) } diff --git a/tests/baselines/reference/asyncAwaitIsolatedModules_es6.symbols b/tests/baselines/reference/asyncAwaitIsolatedModules_es6.symbols index 2d1808b8b8bf5..87ee54146bfad 100644 --- a/tests/baselines/reference/asyncAwaitIsolatedModules_es6.symbols +++ b/tests/baselines/reference/asyncAwaitIsolatedModules_es6.symbols @@ -4,7 +4,7 @@ import { MyPromise } from "missing"; declare var p: Promise; >p : Symbol(p, Decl(asyncAwaitIsolatedModules_es6.ts, 2, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare var mp: MyPromise; >mp : Symbol(mp, Decl(asyncAwaitIsolatedModules_es6.ts, 3, 11)) @@ -15,7 +15,7 @@ async function f0() { } async function f1(): Promise { } >f1 : Symbol(f1, Decl(asyncAwaitIsolatedModules_es6.ts, 5, 23)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) async function f3(): MyPromise { } >f3 : Symbol(f3, Decl(asyncAwaitIsolatedModules_es6.ts, 6, 38)) @@ -26,7 +26,7 @@ let f4 = async function() { } let f5 = async function(): Promise { } >f5 : Symbol(f5, Decl(asyncAwaitIsolatedModules_es6.ts, 10, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let f6 = async function(): MyPromise { } >f6 : Symbol(f6, Decl(asyncAwaitIsolatedModules_es6.ts, 11, 3)) @@ -37,7 +37,7 @@ let f7 = async () => { }; let f8 = async (): Promise => { }; >f8 : Symbol(f8, Decl(asyncAwaitIsolatedModules_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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let f9 = async (): MyPromise => { }; >f9 : Symbol(f9, Decl(asyncAwaitIsolatedModules_es6.ts, 15, 3)) @@ -53,7 +53,7 @@ let f11 = async () => mp; let f12 = async (): Promise => mp; >f12 : Symbol(f12, Decl(asyncAwaitIsolatedModules_es6.ts, 18, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >mp : Symbol(mp, Decl(asyncAwaitIsolatedModules_es6.ts, 3, 11)) let f13 = async (): MyPromise => p; @@ -69,7 +69,7 @@ let o = { async m2(): Promise { }, >m2 : Symbol(m2, Decl(asyncAwaitIsolatedModules_es6.ts, 22, 16)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) async m3(): MyPromise { } >m3 : Symbol(m3, Decl(asyncAwaitIsolatedModules_es6.ts, 23, 31)) @@ -85,7 +85,7 @@ class C { async m2(): Promise { } >m2 : Symbol(C.m2, Decl(asyncAwaitIsolatedModules_es6.ts, 28, 15)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) async m3(): MyPromise { } >m3 : Symbol(C.m3, Decl(asyncAwaitIsolatedModules_es6.ts, 29, 30)) @@ -96,7 +96,7 @@ class C { static async m5(): Promise { } >m5 : Symbol(C.m5, Decl(asyncAwaitIsolatedModules_es6.ts, 31, 22)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) static async m6(): MyPromise { } >m6 : Symbol(C.m6, Decl(asyncAwaitIsolatedModules_es6.ts, 32, 37)) diff --git a/tests/baselines/reference/asyncAwait_es6.symbols b/tests/baselines/reference/asyncAwait_es6.symbols index 9093fc6906435..dafaed09fdac4 100644 --- a/tests/baselines/reference/asyncAwait_es6.symbols +++ b/tests/baselines/reference/asyncAwait_es6.symbols @@ -2,16 +2,16 @@ type MyPromise = Promise; >MyPromise : Symbol(MyPromise, Decl(asyncAwait_es6.ts, 0, 0), Decl(asyncAwait_es6.ts, 1, 11)) >T : Symbol(T, Decl(asyncAwait_es6.ts, 0, 15)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(asyncAwait_es6.ts, 0, 15)) declare var MyPromise: typeof Promise; >MyPromise : Symbol(MyPromise, Decl(asyncAwait_es6.ts, 0, 0), Decl(asyncAwait_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare var p: Promise; >p : Symbol(p, Decl(asyncAwait_es6.ts, 2, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare var mp: MyPromise; >mp : Symbol(mp, Decl(asyncAwait_es6.ts, 3, 11)) @@ -22,7 +22,7 @@ async function f0() { } async function f1(): Promise { } >f1 : Symbol(f1, Decl(asyncAwait_es6.ts, 5, 23)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) async function f3(): MyPromise { } >f3 : Symbol(f3, Decl(asyncAwait_es6.ts, 6, 38)) @@ -33,7 +33,7 @@ let f4 = async function() { } let f5 = async function(): Promise { } >f5 : Symbol(f5, Decl(asyncAwait_es6.ts, 10, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let f6 = async function(): MyPromise { } >f6 : Symbol(f6, Decl(asyncAwait_es6.ts, 11, 3)) @@ -44,7 +44,7 @@ let f7 = async () => { }; 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let f9 = async (): MyPromise => { }; >f9 : Symbol(f9, Decl(asyncAwait_es6.ts, 15, 3)) @@ -60,7 +60,7 @@ let f11 = async () => mp; let f12 = async (): Promise => mp; >f12 : Symbol(f12, Decl(asyncAwait_es6.ts, 18, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >mp : Symbol(mp, Decl(asyncAwait_es6.ts, 3, 11)) let f13 = async (): MyPromise => p; @@ -76,7 +76,7 @@ let o = { async m2(): Promise { }, >m2 : Symbol(m2, Decl(asyncAwait_es6.ts, 22, 16)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) async m3(): MyPromise { } >m3 : Symbol(m3, Decl(asyncAwait_es6.ts, 23, 31)) @@ -92,7 +92,7 @@ class C { async m2(): Promise { } >m2 : Symbol(C.m2, Decl(asyncAwait_es6.ts, 28, 15)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) async m3(): MyPromise { } >m3 : Symbol(C.m3, Decl(asyncAwait_es6.ts, 29, 30)) @@ -103,7 +103,7 @@ class C { static async m5(): Promise { } >m5 : Symbol(C.m5, Decl(asyncAwait_es6.ts, 31, 22)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) static async m6(): MyPromise { } >m6 : Symbol(C.m6, Decl(asyncAwait_es6.ts, 32, 37)) diff --git a/tests/baselines/reference/asyncDeclare_es6.symbols b/tests/baselines/reference/asyncDeclare_es6.symbols index 85ea6c9f9056b..5332b7e93f4dc 100644 --- a/tests/baselines/reference/asyncDeclare_es6.symbols +++ b/tests/baselines/reference/asyncDeclare_es6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/async/es6/asyncDeclare_es6.ts === declare async function foo(): Promise; >foo : Symbol(foo, Decl(asyncDeclare_es6.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/asyncFunctionDeclaration10_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration10_es6.symbols index cbfb1bbf88d82..f04222113663a 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration10_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration10_es6.symbols @@ -2,5 +2,5 @@ async function foo(a = await => await): Promise { >foo : Symbol(foo, Decl(asyncFunctionDeclaration10_es6.ts, 0, 0)) >a : Symbol(a, Decl(asyncFunctionDeclaration10_es6.ts, 0, 19)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/asyncFunctionDeclaration11_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration11_es6.symbols index 2ebbad8ca0897..4c06d15bd603d 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration11_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration11_es6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration11_es6.ts === async function await(): Promise { >await : Symbol(await, Decl(asyncFunctionDeclaration11_es6.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/asyncFunctionDeclaration12_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration12_es6.symbols index f8adf060dc91b..89e42800cd775 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration12_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration12_es6.symbols @@ -2,5 +2,5 @@ var v = async function await(): Promise { } >v : Symbol(v, Decl(asyncFunctionDeclaration12_es6.ts, 0, 3)) >await : Symbol(await, Decl(asyncFunctionDeclaration12_es6.ts, 0, 22)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/asyncFunctionDeclaration13_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration13_es6.symbols index 05d7c586cab23..65227cf510c65 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration13_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration13_es6.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration13_es6.ts === async function foo(): Promise { >foo : Symbol(foo, Decl(asyncFunctionDeclaration13_es6.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) // Legal to use 'await' in a type context. var v: await; diff --git a/tests/baselines/reference/asyncFunctionDeclaration14_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration14_es6.symbols index 89c9913c1cc7b..767125e903be8 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration14_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration14_es6.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration14_es6.ts === async function foo(): Promise { >foo : Symbol(foo, Decl(asyncFunctionDeclaration14_es6.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) return; } diff --git a/tests/baselines/reference/asyncFunctionDeclaration15_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration15_es6.symbols index daf0d23a7e8ab..f78e25f1cac05 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration15_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration15_es6.symbols @@ -28,7 +28,7 @@ async function fn4(): number { } // error async function fn5(): PromiseLike { } // error >fn5 : Symbol(fn5, Decl(asyncFunctionDeclaration15_es6.ts, 7, 32)) ->PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es6.d.ts, --, --)) async function fn6(): Thenable { } // error >fn6 : Symbol(fn6, Decl(asyncFunctionDeclaration15_es6.ts, 8, 43)) diff --git a/tests/baselines/reference/asyncFunctionDeclaration1_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration1_es6.symbols index e8f03e0b55b1c..233600bb30d21 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration1_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration1_es6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration1_es6.ts === async function foo(): Promise { >foo : Symbol(foo, Decl(asyncFunctionDeclaration1_es6.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/asyncFunctionDeclaration5_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration5_es6.symbols index 61f040d283401..e80dcb9224ed9 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration5_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration5_es6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration5_es6.ts === async function foo(await): Promise { >foo : Symbol(foo, Decl(asyncFunctionDeclaration5_es6.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/asyncFunctionDeclaration6_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration6_es6.symbols index e9e5f97ee0e28..e9eada98ecb59 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration6_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration6_es6.symbols @@ -2,5 +2,5 @@ async function foo(a = await): Promise { >foo : Symbol(foo, Decl(asyncFunctionDeclaration6_es6.ts, 0, 0)) >a : Symbol(a, Decl(asyncFunctionDeclaration6_es6.ts, 0, 19)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/asyncFunctionDeclaration7_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration7_es6.symbols index 67b117d59f818..697273a68db73 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration7_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration7_es6.symbols @@ -1,12 +1,12 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration7_es6.ts === async function bar(): Promise { >bar : Symbol(bar, Decl(asyncFunctionDeclaration7_es6.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) // 'await' here is an identifier, and not a yield expression. async function foo(a = await): Promise { >foo : Symbol(foo, Decl(asyncFunctionDeclaration7_es6.ts, 0, 37)) >a : Symbol(a, Decl(asyncFunctionDeclaration7_es6.ts, 2, 21)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } diff --git a/tests/baselines/reference/asyncFunctionDeclaration9_es6.symbols b/tests/baselines/reference/asyncFunctionDeclaration9_es6.symbols index 9d46d6f6d8f84..862559ded7343 100644 --- a/tests/baselines/reference/asyncFunctionDeclaration9_es6.symbols +++ b/tests/baselines/reference/asyncFunctionDeclaration9_es6.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/async/es6/functionDeclarations/asyncFunctionDeclaration9_es6.ts === async function foo(): Promise { >foo : Symbol(foo, Decl(asyncFunctionDeclaration9_es6.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) var v = { [await]: foo } >v : Symbol(v, Decl(asyncFunctionDeclaration9_es6.ts, 1, 5)) diff --git a/tests/baselines/reference/asyncFunctionNoReturnType.errors.txt b/tests/baselines/reference/asyncFunctionNoReturnType.errors.txt index 5d4a87a186ca4..9155606c99fd8 100644 --- a/tests/baselines/reference/asyncFunctionNoReturnType.errors.txt +++ b/tests/baselines/reference/asyncFunctionNoReturnType.errors.txt @@ -1,16 +1,13 @@ error TS2468: Cannot find global value 'Promise'. tests/cases/compiler/asyncFunctionNoReturnType.ts(1,1): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. -tests/cases/compiler/asyncFunctionNoReturnType.ts(2,9): error TS2304: Cannot find name 'window'. !!! error TS2468: Cannot find global value 'Promise'. -==== tests/cases/compiler/asyncFunctionNoReturnType.ts (2 errors) ==== +==== tests/cases/compiler/asyncFunctionNoReturnType.ts (1 errors) ==== async () => { ~~~~~~~~~~~~~ !!! error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. if (window) - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. return; } \ No newline at end of file diff --git a/tests/baselines/reference/asyncFunctionNoReturnType.symbols b/tests/baselines/reference/asyncFunctionNoReturnType.symbols index da7167599c94f..c3b1f385f0dd9 100644 --- a/tests/baselines/reference/asyncFunctionNoReturnType.symbols +++ b/tests/baselines/reference/asyncFunctionNoReturnType.symbols @@ -1,7 +1,8 @@ === tests/cases/compiler/asyncFunctionNoReturnType.ts === async () => { -No type information for this code. if (window) -No type information for this code. return; -No type information for this code.} -No type information for this code. -No type information for this code. \ No newline at end of file + if (window) +>window : Symbol(window, Decl(lib.d.ts, --, --)) + + return; +} + diff --git a/tests/baselines/reference/asyncFunctionNoReturnType.types b/tests/baselines/reference/asyncFunctionNoReturnType.types index 48f8b33c39de8..16cf2aa578a11 100644 --- a/tests/baselines/reference/asyncFunctionNoReturnType.types +++ b/tests/baselines/reference/asyncFunctionNoReturnType.types @@ -3,7 +3,7 @@ async () => { >async () => { if (window) return;} : () => Promise if (window) ->window : any +>window : Window return; } diff --git a/tests/baselines/reference/asyncFunctionReturnType.symbols b/tests/baselines/reference/asyncFunctionReturnType.symbols index ea0df55fb891f..314e8c3949068 100644 --- a/tests/baselines/reference/asyncFunctionReturnType.symbols +++ b/tests/baselines/reference/asyncFunctionReturnType.symbols @@ -8,7 +8,7 @@ async function fAsync() { async function fAsyncExplicit(): Promise<[number, boolean]> { >fAsyncExplicit : Symbol(fAsyncExplicit, Decl(asyncFunctionReturnType.ts, 3, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) // This is contextually typed as a tuple. return [1, true]; @@ -29,7 +29,7 @@ async function fIndexedTypeForStringProp(obj: Obj): Promise { >fIndexedTypeForStringProp : Symbol(fIndexedTypeForStringProp, Decl(asyncFunctionReturnType.ts, 14, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 16, 41)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) return obj.stringProp; @@ -42,13 +42,13 @@ async function fIndexedTypeForPromiseOfStringProp(obj: Obj): PromisefIndexedTypeForPromiseOfStringProp : Symbol(fIndexedTypeForPromiseOfStringProp, Decl(asyncFunctionReturnType.ts, 18, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 20, 50)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) return Promise.resolve(obj.stringProp); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj.stringProp : Symbol(Obj.stringProp, Decl(asyncFunctionReturnType.ts, 11, 15)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 20, 50)) >stringProp : Symbol(Obj.stringProp, Decl(asyncFunctionReturnType.ts, 11, 15)) @@ -58,13 +58,13 @@ async function fIndexedTypeForExplicitPromiseOfStringProp(obj: Obj): PromisefIndexedTypeForExplicitPromiseOfStringProp : Symbol(fIndexedTypeForExplicitPromiseOfStringProp, Decl(asyncFunctionReturnType.ts, 22, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 24, 58)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) return Promise.resolve(obj.stringProp); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) >obj.stringProp : Symbol(Obj.stringProp, Decl(asyncFunctionReturnType.ts, 11, 15)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 24, 58)) @@ -75,7 +75,7 @@ async function fIndexedTypeForAnyProp(obj: Obj): Promise { >fIndexedTypeForAnyProp : Symbol(fIndexedTypeForAnyProp, Decl(asyncFunctionReturnType.ts, 26, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 28, 38)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) return obj.anyProp; @@ -88,13 +88,13 @@ async function fIndexedTypeForPromiseOfAnyProp(obj: Obj): PromisefIndexedTypeForPromiseOfAnyProp : Symbol(fIndexedTypeForPromiseOfAnyProp, Decl(asyncFunctionReturnType.ts, 30, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 32, 47)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) return Promise.resolve(obj.anyProp); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj.anyProp : Symbol(Obj.anyProp, Decl(asyncFunctionReturnType.ts, 12, 23)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 32, 47)) >anyProp : Symbol(Obj.anyProp, Decl(asyncFunctionReturnType.ts, 12, 23)) @@ -104,13 +104,13 @@ async function fIndexedTypeForExplicitPromiseOfAnyProp(obj: Obj): PromisefIndexedTypeForExplicitPromiseOfAnyProp : Symbol(fIndexedTypeForExplicitPromiseOfAnyProp, Decl(asyncFunctionReturnType.ts, 34, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 36, 55)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) return Promise.resolve(obj.anyProp); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) >obj.anyProp : Symbol(Obj.anyProp, Decl(asyncFunctionReturnType.ts, 12, 23)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 36, 55)) @@ -123,7 +123,7 @@ async function fGenericIndexedTypeForStringProp(obj: TObj): Pr >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 40, 66)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 40, 48)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 40, 48)) return obj.stringProp; @@ -138,13 +138,13 @@ async function fGenericIndexedTypeForPromiseOfStringProp(obj: >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 44, 75)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 44, 57)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 44, 57)) return Promise.resolve(obj.stringProp); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj.stringProp : Symbol(Obj.stringProp, Decl(asyncFunctionReturnType.ts, 11, 15)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 44, 75)) >stringProp : Symbol(Obj.stringProp, Decl(asyncFunctionReturnType.ts, 11, 15)) @@ -156,13 +156,13 @@ async function fGenericIndexedTypeForExplicitPromiseOfStringPropObj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 48, 83)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 48, 65)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 48, 65)) return Promise.resolve(obj.stringProp); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 48, 65)) >obj.stringProp : Symbol(Obj.stringProp, Decl(asyncFunctionReturnType.ts, 11, 15)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 48, 83)) @@ -175,7 +175,7 @@ async function fGenericIndexedTypeForAnyProp(obj: TObj): Promi >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 52, 63)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 52, 45)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 52, 45)) return obj.anyProp; @@ -190,13 +190,13 @@ async function fGenericIndexedTypeForPromiseOfAnyProp(obj: TOb >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 56, 72)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 56, 54)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 56, 54)) return Promise.resolve(obj.anyProp); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj.anyProp : Symbol(Obj.anyProp, Decl(asyncFunctionReturnType.ts, 12, 23)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 56, 72)) >anyProp : Symbol(Obj.anyProp, Decl(asyncFunctionReturnType.ts, 12, 23)) @@ -208,13 +208,13 @@ async function fGenericIndexedTypeForExplicitPromiseOfAnyProp( >Obj : Symbol(Obj, Decl(asyncFunctionReturnType.ts, 8, 1)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 60, 80)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 60, 62)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 60, 62)) return Promise.resolve(obj.anyProp); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 60, 62)) >obj.anyProp : Symbol(Obj.anyProp, Decl(asyncFunctionReturnType.ts, 12, 23)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 60, 80)) @@ -231,7 +231,7 @@ async function fGenericIndexedTypeForKPropTObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 64, 43)) >key : Symbol(key, Decl(asyncFunctionReturnType.ts, 64, 93)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 64, 60)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 64, 43)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 64, 60)) @@ -250,14 +250,14 @@ async function fGenericIndexedTypeForPromiseOfKPropTObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 68, 52)) >key : Symbol(key, Decl(asyncFunctionReturnType.ts, 68, 102)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 68, 69)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 68, 52)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 68, 69)) return Promise.resolve(obj[key]); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 68, 92)) >key : Symbol(key, Decl(asyncFunctionReturnType.ts, 68, 102)) } @@ -272,14 +272,14 @@ async function fGenericIndexedTypeForExplicitPromiseOfKPropTObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 72, 60)) >key : Symbol(key, Decl(asyncFunctionReturnType.ts, 72, 110)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 72, 77)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 72, 60)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 72, 77)) return Promise.resolve(obj[key]); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >TObj : Symbol(TObj, Decl(asyncFunctionReturnType.ts, 72, 60)) >K : Symbol(K, Decl(asyncFunctionReturnType.ts, 72, 77)) >obj : Symbol(obj, Decl(asyncFunctionReturnType.ts, 72, 100)) diff --git a/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.symbols b/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.symbols index f6c8862e100e2..a6d0e0716d80c 100644 --- a/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.symbols +++ b/tests/baselines/reference/asyncFunctionsAndStrictNullChecks.symbols @@ -105,7 +105,7 @@ declare function resolve1(value: T): Promise; >T : Symbol(T, Decl(asyncFunctionsAndStrictNullChecks.ts, 17, 26)) >value : Symbol(value, Decl(asyncFunctionsAndStrictNullChecks.ts, 17, 29)) >T : Symbol(T, Decl(asyncFunctionsAndStrictNullChecks.ts, 17, 26)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(asyncFunctionsAndStrictNullChecks.ts, 17, 26)) declare function resolve2(value: T): Windows.Foundation.IPromise; diff --git a/tests/baselines/reference/asyncIIFE.symbols b/tests/baselines/reference/asyncIIFE.symbols index ab7f297379e64..b92404dadab6c 100644 --- a/tests/baselines/reference/asyncIIFE.symbols +++ b/tests/baselines/reference/asyncIIFE.symbols @@ -5,7 +5,7 @@ function f1() { (async () => { await 10 throw new Error(); ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) })(); diff --git a/tests/baselines/reference/asyncImportedPromise_es6.symbols b/tests/baselines/reference/asyncImportedPromise_es6.symbols index 86f037946e217..b9a69b0570f2d 100644 --- a/tests/baselines/reference/asyncImportedPromise_es6.symbols +++ b/tests/baselines/reference/asyncImportedPromise_es6.symbols @@ -2,7 +2,7 @@ export class Task extends Promise { } >Task : Symbol(Task, Decl(task.ts, 0, 0)) >T : Symbol(T, Decl(task.ts, 0, 18)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(task.ts, 0, 18)) === tests/cases/conformance/async/es6/test.ts === diff --git a/tests/baselines/reference/asyncQualifiedReturnType_es6.symbols b/tests/baselines/reference/asyncQualifiedReturnType_es6.symbols index 86f14f2da74cc..6965ef361d256 100644 --- a/tests/baselines/reference/asyncQualifiedReturnType_es6.symbols +++ b/tests/baselines/reference/asyncQualifiedReturnType_es6.symbols @@ -5,7 +5,7 @@ namespace X { export class MyPromise extends Promise { >MyPromise : Symbol(MyPromise, Decl(asyncQualifiedReturnType_es6.ts, 0, 13)) >T : Symbol(T, Decl(asyncQualifiedReturnType_es6.ts, 1, 27)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(asyncQualifiedReturnType_es6.ts, 1, 27)) } } diff --git a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.symbols b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.symbols index afc6968eedbaf..dd896b8813877 100644 --- a/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.symbols +++ b/tests/baselines/reference/asyncUnParenthesizedArrowFunction_es6.symbols @@ -2,7 +2,7 @@ declare function someOtherFunction(i: any): Promise; >someOtherFunction : Symbol(someOtherFunction, Decl(asyncUnParenthesizedArrowFunction_es6.ts, 0, 0)) >i : Symbol(i, Decl(asyncUnParenthesizedArrowFunction_es6.ts, 0, 35)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const x = async i => await someOtherFunction(i) >x : Symbol(x, Decl(asyncUnParenthesizedArrowFunction_es6.ts, 1, 5)) diff --git a/tests/baselines/reference/asyncUseStrict_es6.symbols b/tests/baselines/reference/asyncUseStrict_es6.symbols index deecf6b81fead..79a93033aefb4 100644 --- a/tests/baselines/reference/asyncUseStrict_es6.symbols +++ b/tests/baselines/reference/asyncUseStrict_es6.symbols @@ -4,11 +4,11 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(asyncUseStrict_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) async function func(): Promise { >func : Symbol(func, Decl(asyncUseStrict_es6.ts, 1, 32)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) "use strict"; var b = await p || a; diff --git a/tests/baselines/reference/awaitBinaryExpression1_es6.symbols b/tests/baselines/reference/awaitBinaryExpression1_es6.symbols index f65763b36a368..68052539ce2a9 100644 --- a/tests/baselines/reference/awaitBinaryExpression1_es6.symbols +++ b/tests/baselines/reference/awaitBinaryExpression1_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitBinaryExpression1_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function before(): void; >before : Symbol(before, Decl(awaitBinaryExpression1_es6.ts, 1, 32)) @@ -14,7 +14,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitBinaryExpression1_es6.ts, 3, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitBinaryExpression1_es6.ts, 1, 32)) diff --git a/tests/baselines/reference/awaitBinaryExpression2_es6.symbols b/tests/baselines/reference/awaitBinaryExpression2_es6.symbols index 52fa3178d8a58..4b4c5d9f8d10b 100644 --- a/tests/baselines/reference/awaitBinaryExpression2_es6.symbols +++ b/tests/baselines/reference/awaitBinaryExpression2_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitBinaryExpression2_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function before(): void; >before : Symbol(before, Decl(awaitBinaryExpression2_es6.ts, 1, 32)) @@ -14,7 +14,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitBinaryExpression2_es6.ts, 3, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitBinaryExpression2_es6.ts, 1, 32)) diff --git a/tests/baselines/reference/awaitBinaryExpression3_es6.symbols b/tests/baselines/reference/awaitBinaryExpression3_es6.symbols index db67f41e3a4ea..5d2f580413c89 100644 --- a/tests/baselines/reference/awaitBinaryExpression3_es6.symbols +++ b/tests/baselines/reference/awaitBinaryExpression3_es6.symbols @@ -4,7 +4,7 @@ declare var a: number; declare var p: Promise; >p : Symbol(p, Decl(awaitBinaryExpression3_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function before(): void; >before : Symbol(before, Decl(awaitBinaryExpression3_es6.ts, 1, 31)) @@ -14,7 +14,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitBinaryExpression3_es6.ts, 3, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitBinaryExpression3_es6.ts, 1, 31)) diff --git a/tests/baselines/reference/awaitBinaryExpression4_es6.symbols b/tests/baselines/reference/awaitBinaryExpression4_es6.symbols index 3f16bd0ca6ffd..f1712ff9acb50 100644 --- a/tests/baselines/reference/awaitBinaryExpression4_es6.symbols +++ b/tests/baselines/reference/awaitBinaryExpression4_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitBinaryExpression4_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function before(): void; >before : Symbol(before, Decl(awaitBinaryExpression4_es6.ts, 1, 32)) @@ -14,7 +14,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitBinaryExpression4_es6.ts, 3, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitBinaryExpression4_es6.ts, 1, 32)) diff --git a/tests/baselines/reference/awaitBinaryExpression5_es6.symbols b/tests/baselines/reference/awaitBinaryExpression5_es6.symbols index 2182062def1d9..2528c33b46603 100644 --- a/tests/baselines/reference/awaitBinaryExpression5_es6.symbols +++ b/tests/baselines/reference/awaitBinaryExpression5_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitBinaryExpression5_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function before(): void; >before : Symbol(before, Decl(awaitBinaryExpression5_es6.ts, 1, 32)) @@ -14,7 +14,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitBinaryExpression5_es6.ts, 3, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitBinaryExpression5_es6.ts, 1, 32)) diff --git a/tests/baselines/reference/awaitCallExpression1_es6.symbols b/tests/baselines/reference/awaitCallExpression1_es6.symbols index 8f08901eee7b4..a4e9ed32efbe1 100644 --- a/tests/baselines/reference/awaitCallExpression1_es6.symbols +++ b/tests/baselines/reference/awaitCallExpression1_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitCallExpression1_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : Symbol(fn, Decl(awaitCallExpression1_es6.ts, 1, 32)) @@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Symbol(pfn, Decl(awaitCallExpression1_es6.ts, 4, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >arg0 : Symbol(arg0, Decl(awaitCallExpression1_es6.ts, 4, 28)) >arg1 : Symbol(arg1, Decl(awaitCallExpression1_es6.ts, 4, 42)) >arg2 : Symbol(arg2, Decl(awaitCallExpression1_es6.ts, 4, 57)) declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Symbol(po, Decl(awaitCallExpression1_es6.ts, 5, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn : Symbol(fn, Decl(awaitCallExpression1_es6.ts, 5, 25)) >arg0 : Symbol(arg0, Decl(awaitCallExpression1_es6.ts, 5, 29)) >arg1 : Symbol(arg1, Decl(awaitCallExpression1_es6.ts, 5, 43)) @@ -42,7 +42,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitCallExpression1_es6.ts, 7, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitCallExpression1_es6.ts, 5, 84)) diff --git a/tests/baselines/reference/awaitCallExpression2_es6.symbols b/tests/baselines/reference/awaitCallExpression2_es6.symbols index 335af879cd284..dd0b5f0caccc6 100644 --- a/tests/baselines/reference/awaitCallExpression2_es6.symbols +++ b/tests/baselines/reference/awaitCallExpression2_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitCallExpression2_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : Symbol(fn, Decl(awaitCallExpression2_es6.ts, 1, 32)) @@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Symbol(pfn, Decl(awaitCallExpression2_es6.ts, 4, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >arg0 : Symbol(arg0, Decl(awaitCallExpression2_es6.ts, 4, 28)) >arg1 : Symbol(arg1, Decl(awaitCallExpression2_es6.ts, 4, 42)) >arg2 : Symbol(arg2, Decl(awaitCallExpression2_es6.ts, 4, 57)) declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Symbol(po, Decl(awaitCallExpression2_es6.ts, 5, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn : Symbol(fn, Decl(awaitCallExpression2_es6.ts, 5, 25)) >arg0 : Symbol(arg0, Decl(awaitCallExpression2_es6.ts, 5, 29)) >arg1 : Symbol(arg1, Decl(awaitCallExpression2_es6.ts, 5, 43)) @@ -42,7 +42,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitCallExpression2_es6.ts, 7, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitCallExpression2_es6.ts, 5, 84)) diff --git a/tests/baselines/reference/awaitCallExpression3_es6.symbols b/tests/baselines/reference/awaitCallExpression3_es6.symbols index 7e28ec765ba42..08ed94d6331de 100644 --- a/tests/baselines/reference/awaitCallExpression3_es6.symbols +++ b/tests/baselines/reference/awaitCallExpression3_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitCallExpression3_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : Symbol(fn, Decl(awaitCallExpression3_es6.ts, 1, 32)) @@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Symbol(pfn, Decl(awaitCallExpression3_es6.ts, 4, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >arg0 : Symbol(arg0, Decl(awaitCallExpression3_es6.ts, 4, 28)) >arg1 : Symbol(arg1, Decl(awaitCallExpression3_es6.ts, 4, 42)) >arg2 : Symbol(arg2, Decl(awaitCallExpression3_es6.ts, 4, 57)) declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Symbol(po, Decl(awaitCallExpression3_es6.ts, 5, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn : Symbol(fn, Decl(awaitCallExpression3_es6.ts, 5, 25)) >arg0 : Symbol(arg0, Decl(awaitCallExpression3_es6.ts, 5, 29)) >arg1 : Symbol(arg1, Decl(awaitCallExpression3_es6.ts, 5, 43)) @@ -42,7 +42,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitCallExpression3_es6.ts, 7, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitCallExpression3_es6.ts, 5, 84)) diff --git a/tests/baselines/reference/awaitCallExpression4_es6.symbols b/tests/baselines/reference/awaitCallExpression4_es6.symbols index efc2c9275b6ca..92dbd857d0ac1 100644 --- a/tests/baselines/reference/awaitCallExpression4_es6.symbols +++ b/tests/baselines/reference/awaitCallExpression4_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitCallExpression4_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : Symbol(fn, Decl(awaitCallExpression4_es6.ts, 1, 32)) @@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Symbol(pfn, Decl(awaitCallExpression4_es6.ts, 4, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >arg0 : Symbol(arg0, Decl(awaitCallExpression4_es6.ts, 4, 28)) >arg1 : Symbol(arg1, Decl(awaitCallExpression4_es6.ts, 4, 42)) >arg2 : Symbol(arg2, Decl(awaitCallExpression4_es6.ts, 4, 57)) declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Symbol(po, Decl(awaitCallExpression4_es6.ts, 5, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn : Symbol(fn, Decl(awaitCallExpression4_es6.ts, 5, 25)) >arg0 : Symbol(arg0, Decl(awaitCallExpression4_es6.ts, 5, 29)) >arg1 : Symbol(arg1, Decl(awaitCallExpression4_es6.ts, 5, 43)) @@ -42,7 +42,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitCallExpression4_es6.ts, 7, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitCallExpression4_es6.ts, 5, 84)) diff --git a/tests/baselines/reference/awaitCallExpression5_es6.symbols b/tests/baselines/reference/awaitCallExpression5_es6.symbols index 2861eeb133361..54dd4341869aa 100644 --- a/tests/baselines/reference/awaitCallExpression5_es6.symbols +++ b/tests/baselines/reference/awaitCallExpression5_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitCallExpression5_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : Symbol(fn, Decl(awaitCallExpression5_es6.ts, 1, 32)) @@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Symbol(pfn, Decl(awaitCallExpression5_es6.ts, 4, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >arg0 : Symbol(arg0, Decl(awaitCallExpression5_es6.ts, 4, 28)) >arg1 : Symbol(arg1, Decl(awaitCallExpression5_es6.ts, 4, 42)) >arg2 : Symbol(arg2, Decl(awaitCallExpression5_es6.ts, 4, 57)) declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Symbol(po, Decl(awaitCallExpression5_es6.ts, 5, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn : Symbol(fn, Decl(awaitCallExpression5_es6.ts, 5, 25)) >arg0 : Symbol(arg0, Decl(awaitCallExpression5_es6.ts, 5, 29)) >arg1 : Symbol(arg1, Decl(awaitCallExpression5_es6.ts, 5, 43)) @@ -42,7 +42,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitCallExpression5_es6.ts, 7, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitCallExpression5_es6.ts, 5, 84)) diff --git a/tests/baselines/reference/awaitCallExpression6_es6.symbols b/tests/baselines/reference/awaitCallExpression6_es6.symbols index dc7c711e900e2..00d9b4f4be220 100644 --- a/tests/baselines/reference/awaitCallExpression6_es6.symbols +++ b/tests/baselines/reference/awaitCallExpression6_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitCallExpression6_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : Symbol(fn, Decl(awaitCallExpression6_es6.ts, 1, 32)) @@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Symbol(pfn, Decl(awaitCallExpression6_es6.ts, 4, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >arg0 : Symbol(arg0, Decl(awaitCallExpression6_es6.ts, 4, 28)) >arg1 : Symbol(arg1, Decl(awaitCallExpression6_es6.ts, 4, 42)) >arg2 : Symbol(arg2, Decl(awaitCallExpression6_es6.ts, 4, 57)) declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Symbol(po, Decl(awaitCallExpression6_es6.ts, 5, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn : Symbol(fn, Decl(awaitCallExpression6_es6.ts, 5, 25)) >arg0 : Symbol(arg0, Decl(awaitCallExpression6_es6.ts, 5, 29)) >arg1 : Symbol(arg1, Decl(awaitCallExpression6_es6.ts, 5, 43)) @@ -42,7 +42,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitCallExpression6_es6.ts, 7, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitCallExpression6_es6.ts, 5, 84)) diff --git a/tests/baselines/reference/awaitCallExpression7_es6.symbols b/tests/baselines/reference/awaitCallExpression7_es6.symbols index 17d143e5312cc..24be2b5c84426 100644 --- a/tests/baselines/reference/awaitCallExpression7_es6.symbols +++ b/tests/baselines/reference/awaitCallExpression7_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitCallExpression7_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : Symbol(fn, Decl(awaitCallExpression7_es6.ts, 1, 32)) @@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Symbol(pfn, Decl(awaitCallExpression7_es6.ts, 4, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >arg0 : Symbol(arg0, Decl(awaitCallExpression7_es6.ts, 4, 28)) >arg1 : Symbol(arg1, Decl(awaitCallExpression7_es6.ts, 4, 42)) >arg2 : Symbol(arg2, Decl(awaitCallExpression7_es6.ts, 4, 57)) declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Symbol(po, Decl(awaitCallExpression7_es6.ts, 5, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn : Symbol(fn, Decl(awaitCallExpression7_es6.ts, 5, 25)) >arg0 : Symbol(arg0, Decl(awaitCallExpression7_es6.ts, 5, 29)) >arg1 : Symbol(arg1, Decl(awaitCallExpression7_es6.ts, 5, 43)) @@ -42,7 +42,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitCallExpression7_es6.ts, 7, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitCallExpression7_es6.ts, 5, 84)) diff --git a/tests/baselines/reference/awaitCallExpression8_es6.symbols b/tests/baselines/reference/awaitCallExpression8_es6.symbols index 1b98fc1f4de05..6a8d45250b9fb 100644 --- a/tests/baselines/reference/awaitCallExpression8_es6.symbols +++ b/tests/baselines/reference/awaitCallExpression8_es6.symbols @@ -4,7 +4,7 @@ declare var a: boolean; declare var p: Promise; >p : Symbol(p, Decl(awaitCallExpression8_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare function fn(arg0: boolean, arg1: boolean, arg2: boolean): void; >fn : Symbol(fn, Decl(awaitCallExpression8_es6.ts, 1, 32)) @@ -21,14 +21,14 @@ declare var o: { fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }; declare var pfn: Promise<{ (arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >pfn : Symbol(pfn, Decl(awaitCallExpression8_es6.ts, 4, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >arg0 : Symbol(arg0, Decl(awaitCallExpression8_es6.ts, 4, 28)) >arg1 : Symbol(arg1, Decl(awaitCallExpression8_es6.ts, 4, 42)) >arg2 : Symbol(arg2, Decl(awaitCallExpression8_es6.ts, 4, 57)) declare var po: Promise<{ fn(arg0: boolean, arg1: boolean, arg2: boolean): void; }>; >po : Symbol(po, Decl(awaitCallExpression8_es6.ts, 5, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn : Symbol(fn, Decl(awaitCallExpression8_es6.ts, 5, 25)) >arg0 : Symbol(arg0, Decl(awaitCallExpression8_es6.ts, 5, 29)) >arg1 : Symbol(arg1, Decl(awaitCallExpression8_es6.ts, 5, 43)) @@ -42,7 +42,7 @@ declare function after(): void; async function func(): Promise { >func : Symbol(func, Decl(awaitCallExpression8_es6.ts, 7, 31)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) before(); >before : Symbol(before, Decl(awaitCallExpression8_es6.ts, 5, 84)) diff --git a/tests/baselines/reference/awaitClassExpression_es6.symbols b/tests/baselines/reference/awaitClassExpression_es6.symbols index 6162e121c8101..712bd8f51a494 100644 --- a/tests/baselines/reference/awaitClassExpression_es6.symbols +++ b/tests/baselines/reference/awaitClassExpression_es6.symbols @@ -4,12 +4,12 @@ declare class C { } declare var p: Promise; >p : Symbol(p, Decl(awaitClassExpression_es6.ts, 1, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >C : Symbol(C, Decl(awaitClassExpression_es6.ts, 0, 0)) async function func(): Promise { >func : Symbol(func, Decl(awaitClassExpression_es6.ts, 1, 33)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) class D extends (await p) { >D : Symbol(D, Decl(awaitClassExpression_es6.ts, 3, 38)) diff --git a/tests/baselines/reference/awaitUnion_es6.symbols b/tests/baselines/reference/awaitUnion_es6.symbols index c301f3c5b8dd7..114ef26728728 100644 --- a/tests/baselines/reference/awaitUnion_es6.symbols +++ b/tests/baselines/reference/awaitUnion_es6.symbols @@ -4,20 +4,20 @@ declare let a: number | string; declare let b: PromiseLike | PromiseLike; >b : Symbol(b, Decl(awaitUnion_es6.ts, 1, 11)) ->PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) ->PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es6.d.ts, --, --)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es6.d.ts, --, --)) declare let c: PromiseLike; >c : Symbol(c, Decl(awaitUnion_es6.ts, 2, 11)) ->PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es6.d.ts, --, --)) declare let d: number | PromiseLike; >d : Symbol(d, Decl(awaitUnion_es6.ts, 3, 11)) ->PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es6.d.ts, --, --)) declare let e: number | PromiseLike; >e : Symbol(e, Decl(awaitUnion_es6.ts, 4, 11)) ->PromiseLike : Symbol(PromiseLike, Decl(lib.es5.d.ts, --, --)) +>PromiseLike : Symbol(PromiseLike, Decl(lib.es6.d.ts, --, --)) async function f() { >f : Symbol(f, Decl(awaitUnion_es6.ts, 4, 53)) diff --git a/tests/baselines/reference/bindingPatternInParameter01.errors.txt b/tests/baselines/reference/bindingPatternInParameter01.errors.txt deleted file mode 100644 index bee1f47141ef8..0000000000000 --- a/tests/baselines/reference/bindingPatternInParameter01.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -tests/cases/compiler/bindingPatternInParameter01.ts(4,3): error TS2304: Cannot find name 'console'. - - -==== tests/cases/compiler/bindingPatternInParameter01.ts (1 errors) ==== - const nestedArray = [[[1, 2]], [[3, 4]]]; - - nestedArray.forEach(([[a, b]]) => { - console.log(a, b); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - }); - \ No newline at end of file diff --git a/tests/baselines/reference/bindingPatternInParameter01.symbols b/tests/baselines/reference/bindingPatternInParameter01.symbols index 466c7a0bc70a5..01bb9b3eb25c0 100644 --- a/tests/baselines/reference/bindingPatternInParameter01.symbols +++ b/tests/baselines/reference/bindingPatternInParameter01.symbols @@ -10,6 +10,9 @@ nestedArray.forEach(([[a, b]]) => { >b : Symbol(b, Decl(bindingPatternInParameter01.ts, 2, 25)) console.log(a, b); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(bindingPatternInParameter01.ts, 2, 23)) >b : Symbol(b, Decl(bindingPatternInParameter01.ts, 2, 25)) diff --git a/tests/baselines/reference/bindingPatternInParameter01.types b/tests/baselines/reference/bindingPatternInParameter01.types index 927deae8c07d0..4fac8c8fd7d72 100644 --- a/tests/baselines/reference/bindingPatternInParameter01.types +++ b/tests/baselines/reference/bindingPatternInParameter01.types @@ -21,10 +21,10 @@ nestedArray.forEach(([[a, b]]) => { >b : number console.log(a, b); ->console.log(a, b) : any ->console.log : any ->console : any ->log : any +>console.log(a, b) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >a : number >b : number diff --git a/tests/baselines/reference/binopAssignmentShouldHaveType.symbols b/tests/baselines/reference/binopAssignmentShouldHaveType.symbols index ae7a3c521afe5..70c594628bf6b 100644 --- a/tests/baselines/reference/binopAssignmentShouldHaveType.symbols +++ b/tests/baselines/reference/binopAssignmentShouldHaveType.symbols @@ -21,12 +21,12 @@ module Test { >name : Symbol(name, Decl(binopAssignmentShouldHaveType.ts, 8, 6)) if ((name= this.getName()).length > 0) { ->(name= this.getName()).length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>(name= this.getName()).length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >name : Symbol(name, Decl(binopAssignmentShouldHaveType.ts, 8, 6)) >this.getName : Symbol(Bug.getName, Decl(binopAssignmentShouldHaveType.ts, 3, 19)) >this : Symbol(Bug, Decl(binopAssignmentShouldHaveType.ts, 2, 13)) >getName : Symbol(Bug.getName, Decl(binopAssignmentShouldHaveType.ts, 3, 19)) ->length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) console.log(name); >console : Symbol(console, Decl(binopAssignmentShouldHaveType.ts, 0, 11)) diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols index f1fa53d7b6ca6..a281c73802719 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.symbols @@ -195,8 +195,8 @@ interface A { // T (a: Date): Date; >a : Symbol(a, Decl(callSignatureAssignabilityInInheritance2.ts, 42, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }): any[]; }; diff --git a/tests/baselines/reference/callWithSpreadES6.symbols b/tests/baselines/reference/callWithSpreadES6.symbols index dd12cd818061c..872ce1319178d 100644 --- a/tests/baselines/reference/callWithSpreadES6.symbols +++ b/tests/baselines/reference/callWithSpreadES6.symbols @@ -93,7 +93,7 @@ xa[1].foo(1, 2, ...a, "abc"); >a : Symbol(a, Decl(callWithSpreadES6.ts, 7, 3)) (xa[1].foo)(...[1, 2, "abc"]); ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >xa[1].foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 0, 13)) >xa : Symbol(xa, Decl(callWithSpreadES6.ts, 10, 3)) >foo : Symbol(X.foo, Decl(callWithSpreadES6.ts, 0, 13)) diff --git a/tests/baselines/reference/capturedLetConstInLoop2_ES6.symbols b/tests/baselines/reference/capturedLetConstInLoop2_ES6.symbols index ff1054c2b213a..525bc529e161d 100644 --- a/tests/baselines/reference/capturedLetConstInLoop2_ES6.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop2_ES6.symbols @@ -9,9 +9,9 @@ function foo0(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 3, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 2, 12)) @@ -32,9 +32,9 @@ function foo0_1(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 11, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 10, 12)) @@ -57,9 +57,9 @@ function foo1(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 19, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 18, 12)) @@ -78,9 +78,9 @@ function foo2(x) { while (1 === 1) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 27, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 25, 14)) @@ -102,9 +102,9 @@ function foo3(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 36, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 35, 11)) @@ -128,9 +128,9 @@ function foo4(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 44, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) let x = 1; >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 45, 11)) @@ -157,9 +157,9 @@ function foo5(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 53, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + y + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 52, 12)) @@ -185,9 +185,9 @@ function foo6(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 63, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + y + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 62, 11)) @@ -212,9 +212,9 @@ function foo7(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 72, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + y + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 71, 11)) @@ -244,9 +244,9 @@ function foo8(x) { let a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 82, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + y + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 81, 11)) @@ -269,9 +269,9 @@ function foo0_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 90, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 89, 14)) @@ -292,9 +292,9 @@ function foo0_1_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 98, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 97, 14)) @@ -316,9 +316,9 @@ function foo1_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 106, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 105, 14)) @@ -337,9 +337,9 @@ function foo2_c(x) { while (1 === 1) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 114, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 112, 16)) @@ -361,9 +361,9 @@ function foo3_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 123, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 122, 13)) @@ -386,9 +386,9 @@ function foo4_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 131, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) const x = 1; >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 132, 13)) @@ -414,9 +414,9 @@ function foo5_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 140, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + y + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 139, 14)) @@ -442,9 +442,9 @@ function foo6_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 150, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + y + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 149, 13)) @@ -469,9 +469,9 @@ function foo7_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 159, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + y + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 158, 13)) @@ -500,9 +500,9 @@ function foo8_c(x) { const a = arguments.length; >a : Symbol(a, Decl(capturedLetConstInLoop2_ES6.ts, 169, 13)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return x + y + a }); >x : Symbol(x, Decl(capturedLetConstInLoop2_ES6.ts, 168, 13)) diff --git a/tests/baselines/reference/capturedLetConstInLoop9_ES6.symbols b/tests/baselines/reference/capturedLetConstInLoop9_ES6.symbols index 4d4013096fcc8..f20c659643174 100644 --- a/tests/baselines/reference/capturedLetConstInLoop9_ES6.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop9_ES6.symbols @@ -126,9 +126,9 @@ function foo() { >z1 : Symbol(z1, Decl(capturedLetConstInLoop9_ES6.ts, 67, 21)) >x1 : Symbol(x1, Decl(capturedLetConstInLoop9_ES6.ts, 67, 33)) >y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 67, 38)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) if (b === 1) { >b : Symbol(b, Decl(capturedLetConstInLoop9_ES6.ts, 66, 16)) @@ -246,24 +246,24 @@ function foo3 () { let x = arguments.length; >x : Symbol(x, Decl(capturedLetConstInLoop9_ES6.ts, 131, 7)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) for (let y of []) { >y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 132, 12)) let z = arguments.length; >z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 133, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) (function() { return y + z + arguments.length; }); >y : Symbol(y, Decl(capturedLetConstInLoop9_ES6.ts, 132, 12)) >z : Symbol(z, Decl(capturedLetConstInLoop9_ES6.ts, 133, 11)) ->arguments.length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>arguments.length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) >arguments : Symbol(arguments) ->length : Symbol(IArguments.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(IArguments.length, Decl(lib.es6.d.ts, --, --)) } } diff --git a/tests/baselines/reference/chainedAssignment2.symbols b/tests/baselines/reference/chainedAssignment2.symbols index 0f37d41c3bea7..fe3b67e47cbf7 100644 --- a/tests/baselines/reference/chainedAssignment2.symbols +++ b/tests/baselines/reference/chainedAssignment2.symbols @@ -10,7 +10,7 @@ var c: boolean; var d: Date; >d : Symbol(d, Decl(chainedAssignment2.ts, 3, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var e: RegExp; >e : Symbol(e, Decl(chainedAssignment2.ts, 4, 3)) diff --git a/tests/baselines/reference/classExpressionWithStaticProperties3.symbols b/tests/baselines/reference/classExpressionWithStaticProperties3.symbols index 2cf04ac05d3bc..1ce28c7aab8ea 100644 --- a/tests/baselines/reference/classExpressionWithStaticProperties3.symbols +++ b/tests/baselines/reference/classExpressionWithStaticProperties3.symbols @@ -12,9 +12,9 @@ for (let i = 0; i < 3; i++) { >i : Symbol(i, Decl(classExpressionWithStaticProperties3.ts, 2, 8)) arr.push(class C { ->arr.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>arr.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >arr : Symbol(arr, Decl(classExpressionWithStaticProperties3.ts, 1, 5)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >C : Symbol(C, Decl(classExpressionWithStaticProperties3.ts, 3, 13)) static x = i; @@ -30,9 +30,9 @@ for (let i = 0; i < 3; i++) { }); } arr.forEach(C => console.log(C.y())); ->arr.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>arr.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >arr : Symbol(arr, Decl(classExpressionWithStaticProperties3.ts, 1, 5)) ->forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >C : Symbol(C, Decl(classExpressionWithStaticProperties3.ts, 8, 12)) >console : Symbol(console, Decl(classExpressionWithStaticProperties3.ts, 0, 11)) >C.y : Symbol(y, Decl(classExpressionWithStaticProperties3.ts, 1, 12)) diff --git a/tests/baselines/reference/classExtendingBuiltinType.symbols b/tests/baselines/reference/classExtendingBuiltinType.symbols index fb0814cc0f2bc..d7ef51fe51035 100644 --- a/tests/baselines/reference/classExtendingBuiltinType.symbols +++ b/tests/baselines/reference/classExtendingBuiltinType.symbols @@ -21,7 +21,7 @@ class C5 extends Number { } class C6 extends Date { } >C6 : Symbol(C6, Decl(classExtendingBuiltinType.ts, 4, 27)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) class C7 extends RegExp { } >C7 : Symbol(C7, Decl(classExtendingBuiltinType.ts, 5, 25)) diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.symbols b/tests/baselines/reference/classWithoutExplicitConstructor.symbols index 103fcd30bef32..e75ef83d8af69 100644 --- a/tests/baselines/reference/classWithoutExplicitConstructor.symbols +++ b/tests/baselines/reference/classWithoutExplicitConstructor.symbols @@ -20,7 +20,7 @@ var c2 = new C(null); // error class D { >D : Symbol(D, Decl(classWithoutExplicitConstructor.ts, 6, 21)) >T : Symbol(T, Decl(classWithoutExplicitConstructor.ts, 8, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) x = 2 >x : Symbol(D.x, Decl(classWithoutExplicitConstructor.ts, 8, 25)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols index 6df267080783d..f3189aad873b0 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols @@ -82,7 +82,7 @@ true, {} >BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3)) "string", new Date() ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) STRING.toLowerCase(), new CLASS() >STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) @@ -110,7 +110,7 @@ var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" }); var resultIsObject10 = ("string", new Date()); >resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var resultIsObject11 = (STRING.toLowerCase(), new CLASS()); >resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols index 2d9fc665a810b..02a375ea93e94 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols @@ -71,7 +71,7 @@ null, STRING; ANY = new Date(), STRING; >ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) true, ""; @@ -96,7 +96,7 @@ var resultIsString6 = (null, STRING); var resultIsString7 = (ANY = new Date(), STRING); >resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3)) >ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3)) var resultIsString8 = (true, ""); diff --git a/tests/baselines/reference/computedPropertyNames3_ES6.symbols b/tests/baselines/reference/computedPropertyNames3_ES6.symbols index 7e51c7a22988f..049da49e5a56d 100644 --- a/tests/baselines/reference/computedPropertyNames3_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNames3_ES6.symbols @@ -14,7 +14,7 @@ class C { >v : Symbol(v, Decl(computedPropertyNames3_ES6.ts, 5, 17)) static get [""]() { } ->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) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) static set [id.toString()](v) { } >id : Symbol(id, Decl(computedPropertyNames3_ES6.ts, 0, 3)) diff --git a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols index ef5d519c3a036..5519781b79af5 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType1_ES6.symbols @@ -17,13 +17,13 @@ var o: I = { ["" + 0](y) { return y.length; }, >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 13)) ->y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>y.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 6, 13)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) ["" + 1]: y => y.length >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 7, 13)) ->y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>y.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType1_ES6.ts, 7, 13)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols index d8cab4c4a5277..c1507c501ef43 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType2_ES6.symbols @@ -17,13 +17,13 @@ var o: I = { [+"foo"](y) { return y.length; }, >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 13)) ->y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>y.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 6, 13)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) [+"bar"]: y => y.length >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 7, 13)) ->y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>y.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType2_ES6.ts, 7, 13)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols index deea9bff3df41..2d3d48fe30454 100644 --- a/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols +++ b/tests/baselines/reference/computedPropertyNamesContextualType3_ES6.symbols @@ -13,13 +13,13 @@ var o: I = { [+"foo"](y) { return y.length; }, >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 13)) ->y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>y.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 5, 13)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) [+"bar"]: y => y.length >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 6, 13)) ->y.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>y.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(computedPropertyNamesContextualType3_ES6.ts, 6, 13)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols index 2c000f17bf68b..4473580e4642d 100644 --- a/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols +++ b/tests/baselines/reference/conditionalOperatorConditionIsObjectType.symbols @@ -120,7 +120,7 @@ foo() ? exprAny1 : exprAny2; >exprAny2 : Symbol(exprAny2, Decl(conditionalOperatorConditionIsObjectType.ts, 9, 3)) new Date() ? exprBoolean1 : exprBoolean2; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) >exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) @@ -144,7 +144,7 @@ condObject.valueOf() ? exprIsObject1 : exprIsObject2; >exprIsObject2 : Symbol(exprIsObject2, Decl(conditionalOperatorConditionIsObjectType.ts, 13, 3)) new Date() ? exprString1 : exprBoolean1; // union ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >exprString1 : Symbol(exprString1, Decl(conditionalOperatorConditionIsObjectType.ts, 6, 3)) >exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) @@ -237,7 +237,7 @@ var resultIsAny3 = foo() ? exprAny1 : exprAny2; var resultIsBoolean3 = new Date() ? exprBoolean1 : exprBoolean2; >resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(conditionalOperatorConditionIsObjectType.ts, 58, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >exprBoolean1 : Symbol(exprBoolean1, Decl(conditionalOperatorConditionIsObjectType.ts, 4, 3)) >exprBoolean2 : Symbol(exprBoolean2, Decl(conditionalOperatorConditionIsObjectType.ts, 10, 3)) diff --git a/tests/baselines/reference/constDeclarations-access2.symbols b/tests/baselines/reference/constDeclarations-access2.symbols index 0f67618b1ad80..5fdea9bf1b8aa 100644 --- a/tests/baselines/reference/constDeclarations-access2.symbols +++ b/tests/baselines/reference/constDeclarations-access2.symbols @@ -83,7 +83,7 @@ x; >x : Symbol(x, Decl(constDeclarations-access2.ts, 0, 5)) x.toString(); ->x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>x.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(constDeclarations-access2.ts, 0, 5)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/constDeclarations-access3.symbols b/tests/baselines/reference/constDeclarations-access3.symbols index 43049ff355a54..ef064d931ef72 100644 --- a/tests/baselines/reference/constDeclarations-access3.symbols +++ b/tests/baselines/reference/constDeclarations-access3.symbols @@ -139,9 +139,9 @@ M.x; >x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16)) M.x.toString(); ->M.x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>M.x.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) >M.x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16)) >M : Symbol(M, Decl(constDeclarations-access3.ts, 0, 0)) >x : Symbol(M.x, Decl(constDeclarations-access3.ts, 1, 16)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/constDeclarations-access4.symbols b/tests/baselines/reference/constDeclarations-access4.symbols index 4e5179f1e8155..e276d4ba5dba3 100644 --- a/tests/baselines/reference/constDeclarations-access4.symbols +++ b/tests/baselines/reference/constDeclarations-access4.symbols @@ -139,9 +139,9 @@ M.x; >x : Symbol(M.x, Decl(constDeclarations-access4.ts, 1, 9)) M.x.toString(); ->M.x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>M.x.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) >M.x : Symbol(M.x, Decl(constDeclarations-access4.ts, 1, 9)) >M : Symbol(M, Decl(constDeclarations-access4.ts, 0, 0)) >x : Symbol(M.x, Decl(constDeclarations-access4.ts, 1, 9)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/constDeclarations-access5.symbols b/tests/baselines/reference/constDeclarations-access5.symbols index 776f78b801581..fe20fc4da2af3 100644 --- a/tests/baselines/reference/constDeclarations-access5.symbols +++ b/tests/baselines/reference/constDeclarations-access5.symbols @@ -139,11 +139,11 @@ m.x; >x : Symbol(m.x, Decl(constDeclarations_access_1.ts, 0, 12)) m.x.toString(); ->m.x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>m.x.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) >m.x : Symbol(m.x, Decl(constDeclarations_access_1.ts, 0, 12)) >m : Symbol(m, Decl(constDeclarations_access_2.ts, 0, 0)) >x : Symbol(m.x, Decl(constDeclarations_access_1.ts, 0, 12)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) === tests/cases/compiler/constDeclarations_access_1.ts === export const x = 0; diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols index 4d63a7f2db4d3..e56a1f7721166 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.symbols @@ -195,8 +195,8 @@ interface A { // T new (a: Date): Date; >a : Symbol(a, Decl(constructSignatureAssignabilityInInheritance2.ts, 42, 17)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }): any[]; }; diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols b/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols index 7403c126f4501..4693d6d3b0107 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues.symbols @@ -34,7 +34,7 @@ class D { class E { >E : Symbol(E, Decl(constructorImplementationWithDefaultValues.ts, 12, 1)) >T : Symbol(T, Decl(constructorImplementationWithDefaultValues.ts, 14, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) constructor(x); >x : Symbol(x, Decl(constructorImplementationWithDefaultValues.ts, 15, 16)) diff --git a/tests/baselines/reference/constructorImplementationWithDefaultValues2.symbols b/tests/baselines/reference/constructorImplementationWithDefaultValues2.symbols index 69c26e440c8c4..fa7434ae5b21f 100644 --- a/tests/baselines/reference/constructorImplementationWithDefaultValues2.symbols +++ b/tests/baselines/reference/constructorImplementationWithDefaultValues2.symbols @@ -41,7 +41,7 @@ class D { class E { >E : Symbol(E, Decl(constructorImplementationWithDefaultValues2.ts, 12, 1)) >T : Symbol(T, Decl(constructorImplementationWithDefaultValues2.ts, 14, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) constructor(x); >x : Symbol(x, Decl(constructorImplementationWithDefaultValues2.ts, 15, 16)) @@ -49,7 +49,7 @@ class E { constructor(x: T = new Date()) { // error >x : Symbol(x, Decl(constructorImplementationWithDefaultValues2.ts, 16, 16)) >T : Symbol(T, Decl(constructorImplementationWithDefaultValues2.ts, 14, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var y = x; >y : Symbol(y, Decl(constructorImplementationWithDefaultValues2.ts, 17, 11)) diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index 708f175c00250..7ef600f276610 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -18,9 +18,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,28): error TS tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,41): error TS1005: ';' expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(40,45): error TS1002: Unterminated string literal. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(41,21): error TS2365: Operator '!=' cannot be applied to types 'boolean' and '0'. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(47,17): error TS2304: Cannot find name 'console'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(49,13): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected. -tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(53,13): error TS2304: Cannot find name 'console'. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(58,5): error TS1128: Declaration or statement expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(69,13): error TS1109: Expression expected. tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(72,37): error TS1127: Invalid character. @@ -87,7 +85,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,55): error T tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (87 errors) ==== +==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (85 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -178,8 +176,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS } catch (e) { console.log(e); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. } finally { ~~~~~~~ @@ -188,8 +184,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS } console.log('Done'); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. return 0; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.symbols b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.symbols index 7374c67325d3a..65b763379ea05 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.symbols +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.symbols @@ -86,6 +86,9 @@ module TypeScriptAllInOne { >e : Symbol(e, Decl(constructorWithIncompleteTypeAnnotation.ts, 45, 19)) console.log(e); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >e : Symbol(e, Decl(constructorWithIncompleteTypeAnnotation.ts, 45, 19)) } finally { @@ -93,6 +96,9 @@ module TypeScriptAllInOne { } console.log('Done'); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) return 0; diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types index a0c5f95cbbdf5..e62573495849b 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.types @@ -128,10 +128,10 @@ module TypeScriptAllInOne { >e : any console.log(e); ->console.log(e) : any ->console.log : any ->console : any ->log : any +>console.log(e) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >e : any } finally { @@ -139,10 +139,10 @@ module TypeScriptAllInOne { } console.log('Done'); ->console.log('Done') : any ->console.log : any ->console : any ->log : any +>console.log('Done') : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >'Done' : "Done" return 0; diff --git a/tests/baselines/reference/contextualTypingOfArrayLiterals1.symbols b/tests/baselines/reference/contextualTypingOfArrayLiterals1.symbols index 5e4c341736b51..49467dee86f1b 100644 --- a/tests/baselines/reference/contextualTypingOfArrayLiterals1.symbols +++ b/tests/baselines/reference/contextualTypingOfArrayLiterals1.symbols @@ -4,13 +4,13 @@ interface I { [x: number]: Date; >x : Symbol(x, Decl(contextualTypingOfArrayLiterals1.ts, 1, 4)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var x3: I = [new Date(), 1]; >x3 : Symbol(x3, Decl(contextualTypingOfArrayLiterals1.ts, 4, 3)) >I : Symbol(I, Decl(contextualTypingOfArrayLiterals1.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r2 = x3[1]; >r2 : Symbol(r2, Decl(contextualTypingOfArrayLiterals1.ts, 5, 3)) diff --git a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.symbols b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.symbols index 203d85b181d16..9b7ad31d01ca2 100644 --- a/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.symbols +++ b/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.symbols @@ -29,7 +29,7 @@ interface Combinators { >f : Symbol(f, Decl(contextualTypingOfGenericFunctionTypedArguments1.ts, 7, 32)) >x : Symbol(x, Decl(contextualTypingOfGenericFunctionTypedArguments1.ts, 7, 37)) >T : Symbol(T, Decl(contextualTypingOfGenericFunctionTypedArguments1.ts, 7, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var c2: Collection; diff --git a/tests/baselines/reference/contextualTypingOfTooShortOverloads.symbols b/tests/baselines/reference/contextualTypingOfTooShortOverloads.symbols index 8f196cf48252d..dedfd7b6fa529 100644 --- a/tests/baselines/reference/contextualTypingOfTooShortOverloads.symbols +++ b/tests/baselines/reference/contextualTypingOfTooShortOverloads.symbols @@ -81,8 +81,8 @@ interface IRouterMatcher { type PathParams = string | RegExp | (string | RegExp)[]; >PathParams : Symbol(PathParams, Decl(contextualTypingOfTooShortOverloads.ts, 25, 1)) ->RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>RegExp : Symbol(RegExp, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>RegExp : Symbol(RegExp, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) type RequestHandlerParams = RequestHandler | ErrorRequestHandler | (RequestHandler | ErrorRequestHandler)[]; >RequestHandlerParams : Symbol(RequestHandlerParams, Decl(contextualTypingOfTooShortOverloads.ts, 27, 56)) diff --git a/tests/baselines/reference/controlFlowInstanceof.symbols b/tests/baselines/reference/controlFlowInstanceof.symbols index f61f6b58616a1..8ca252c2befdb 100644 --- a/tests/baselines/reference/controlFlowInstanceof.symbols +++ b/tests/baselines/reference/controlFlowInstanceof.symbols @@ -4,19 +4,19 @@ function f1(s: Set | Set) { >f1 : Symbol(f1, Decl(controlFlowInstanceof.ts, 0, 0)) >s : Symbol(s, Decl(controlFlowInstanceof.ts, 2, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s = new Set(); >s : Symbol(s, Decl(controlFlowInstanceof.ts, 2, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s; // Set >s : Symbol(s, Decl(controlFlowInstanceof.ts, 2, 12)) if (s instanceof Set) { >s : Symbol(s, Decl(controlFlowInstanceof.ts, 2, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s; // Set >s : Symbol(s, Decl(controlFlowInstanceof.ts, 2, 12)) @@ -25,27 +25,27 @@ function f1(s: Set | Set) { >s : Symbol(s, Decl(controlFlowInstanceof.ts, 2, 12)) s.add(42); ->s.add : Symbol(Set.add, Decl(lib.es2015.collection.d.ts, --, --)) +>s.add : Symbol(Set.add, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(controlFlowInstanceof.ts, 2, 12)) ->add : Symbol(Set.add, Decl(lib.es2015.collection.d.ts, --, --)) +>add : Symbol(Set.add, Decl(lib.es6.d.ts, --, --)) } function f2(s: Set | Set) { >f2 : Symbol(f2, Decl(controlFlowInstanceof.ts, 10, 1)) >s : Symbol(s, Decl(controlFlowInstanceof.ts, 12, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s = new Set(); >s : Symbol(s, Decl(controlFlowInstanceof.ts, 12, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s; // Set >s : Symbol(s, Decl(controlFlowInstanceof.ts, 12, 12)) if (s instanceof Promise) { >s : Symbol(s, Decl(controlFlowInstanceof.ts, 12, 12)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s; // Set & Promise >s : Symbol(s, Decl(controlFlowInstanceof.ts, 12, 12)) @@ -54,23 +54,23 @@ function f2(s: Set | Set) { >s : Symbol(s, Decl(controlFlowInstanceof.ts, 12, 12)) s.add(42); ->s.add : Symbol(Set.add, Decl(lib.es2015.collection.d.ts, --, --)) +>s.add : Symbol(Set.add, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(controlFlowInstanceof.ts, 12, 12)) ->add : Symbol(Set.add, Decl(lib.es2015.collection.d.ts, --, --)) +>add : Symbol(Set.add, Decl(lib.es6.d.ts, --, --)) } function f3(s: Set | Set) { >f3 : Symbol(f3, Decl(controlFlowInstanceof.ts, 20, 1)) >s : Symbol(s, Decl(controlFlowInstanceof.ts, 22, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s; // Set | Set >s : Symbol(s, Decl(controlFlowInstanceof.ts, 22, 12)) if (s instanceof Set) { >s : Symbol(s, Decl(controlFlowInstanceof.ts, 22, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s; // Set | Set >s : Symbol(s, Decl(controlFlowInstanceof.ts, 22, 12)) @@ -84,19 +84,19 @@ function f3(s: Set | Set) { function f4(s: Set | Set) { >f4 : Symbol(f4, Decl(controlFlowInstanceof.ts, 30, 1)) >s : Symbol(s, Decl(controlFlowInstanceof.ts, 32, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s = new Set(); >s : Symbol(s, Decl(controlFlowInstanceof.ts, 32, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s; // Set >s : Symbol(s, Decl(controlFlowInstanceof.ts, 32, 12)) if (s instanceof Set) { >s : Symbol(s, Decl(controlFlowInstanceof.ts, 32, 12)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) s; // Set >s : Symbol(s, Decl(controlFlowInstanceof.ts, 32, 12)) diff --git a/tests/baselines/reference/controlFlowLoopAnalysis.js b/tests/baselines/reference/controlFlowLoopAnalysis.js index fa8dc29e92a9c..de2f457959ced 100644 --- a/tests/baselines/reference/controlFlowLoopAnalysis.js +++ b/tests/baselines/reference/controlFlowLoopAnalysis.js @@ -77,7 +77,7 @@ function test2() { // Repro from #8511 function mapUntilCant(values, canTake, mapping) { var result = []; - for (var index = 0, length = values.length; index < length; index++) { + for (var index = 0, length_1 = values.length; index < length_1; index++) { var value = values[index]; if (canTake(value, index)) { result.push(mapping(value, index)); diff --git a/tests/baselines/reference/copyrightWithNewLine1.errors.txt b/tests/baselines/reference/copyrightWithNewLine1.errors.txt index 11c34ed86a7da..9f5932a2b2ec7 100644 --- a/tests/baselines/reference/copyrightWithNewLine1.errors.txt +++ b/tests/baselines/reference/copyrightWithNewLine1.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/copyrightWithNewLine1.ts(5,24): error TS2307: Cannot find module './greeter'. -tests/cases/compiler/copyrightWithNewLine1.ts(6,10): error TS2304: Cannot find name 'document'. -==== tests/cases/compiler/copyrightWithNewLine1.ts (2 errors) ==== +==== tests/cases/compiler/copyrightWithNewLine1.ts (1 errors) ==== /***************************** * (c) Copyright - Important ****************************/ @@ -11,8 +10,6 @@ tests/cases/compiler/copyrightWithNewLine1.ts(6,10): error TS2304: Cannot find n ~~~~~~~~~~~ !!! error TS2307: Cannot find module './greeter'. var el = document.getElementById('content'); - ~~~~~~~~ -!!! error TS2304: Cannot find name 'document'. var greeter = new model.Greeter(el); /** things */ greeter.start(); \ No newline at end of file diff --git a/tests/baselines/reference/copyrightWithNewLine1.symbols b/tests/baselines/reference/copyrightWithNewLine1.symbols index 85b32678786b6..7d471ba6480f9 100644 --- a/tests/baselines/reference/copyrightWithNewLine1.symbols +++ b/tests/baselines/reference/copyrightWithNewLine1.symbols @@ -8,6 +8,9 @@ import model = require("./greeter") var el = document.getElementById('content'); >el : Symbol(el, Decl(copyrightWithNewLine1.ts, 5, 3)) +>document.getElementById : Symbol(Document.getElementById, Decl(lib.d.ts, --, --)) +>document : Symbol(document, Decl(lib.d.ts, --, --)) +>getElementById : Symbol(Document.getElementById, Decl(lib.d.ts, --, --)) var greeter = new model.Greeter(el); >greeter : Symbol(greeter, Decl(copyrightWithNewLine1.ts, 6, 3)) diff --git a/tests/baselines/reference/copyrightWithNewLine1.types b/tests/baselines/reference/copyrightWithNewLine1.types index 7130bda51ac1c..b51de4f434e9a 100644 --- a/tests/baselines/reference/copyrightWithNewLine1.types +++ b/tests/baselines/reference/copyrightWithNewLine1.types @@ -7,11 +7,11 @@ import model = require("./greeter") >model : any var el = document.getElementById('content'); ->el : any ->document.getElementById('content') : any ->document.getElementById : any ->document : any ->getElementById : any +>el : HTMLElement +>document.getElementById('content') : HTMLElement +>document.getElementById : (elementId: string) => HTMLElement +>document : Document +>getElementById : (elementId: string) => HTMLElement >'content' : "content" var greeter = new model.Greeter(el); @@ -20,7 +20,7 @@ var greeter = new model.Greeter(el); >model.Greeter : any >model : any >Greeter : any ->el : any +>el : HTMLElement /** things */ greeter.start(); diff --git a/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt b/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt index d7f5f3129c709..71194988ca235 100644 --- a/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt +++ b/tests/baselines/reference/copyrightWithoutNewLine1.errors.txt @@ -1,8 +1,7 @@ tests/cases/compiler/copyrightWithoutNewLine1.ts(4,24): error TS2307: Cannot find module './greeter'. -tests/cases/compiler/copyrightWithoutNewLine1.ts(5,10): error TS2304: Cannot find name 'document'. -==== tests/cases/compiler/copyrightWithoutNewLine1.ts (2 errors) ==== +==== tests/cases/compiler/copyrightWithoutNewLine1.ts (1 errors) ==== /***************************** * (c) Copyright - Important ****************************/ @@ -10,8 +9,6 @@ tests/cases/compiler/copyrightWithoutNewLine1.ts(5,10): error TS2304: Cannot fin ~~~~~~~~~~~ !!! error TS2307: Cannot find module './greeter'. var el = document.getElementById('content'); - ~~~~~~~~ -!!! error TS2304: Cannot find name 'document'. var greeter = new model.Greeter(el); /** things */ greeter.start(); \ No newline at end of file diff --git a/tests/baselines/reference/copyrightWithoutNewLine1.symbols b/tests/baselines/reference/copyrightWithoutNewLine1.symbols index 50ee2f932da20..cfed113375398 100644 --- a/tests/baselines/reference/copyrightWithoutNewLine1.symbols +++ b/tests/baselines/reference/copyrightWithoutNewLine1.symbols @@ -7,6 +7,9 @@ import model = require("./greeter") var el = document.getElementById('content'); >el : Symbol(el, Decl(copyrightWithoutNewLine1.ts, 4, 3)) +>document.getElementById : Symbol(Document.getElementById, Decl(lib.d.ts, --, --)) +>document : Symbol(document, Decl(lib.d.ts, --, --)) +>getElementById : Symbol(Document.getElementById, Decl(lib.d.ts, --, --)) var greeter = new model.Greeter(el); >greeter : Symbol(greeter, Decl(copyrightWithoutNewLine1.ts, 5, 3)) diff --git a/tests/baselines/reference/copyrightWithoutNewLine1.types b/tests/baselines/reference/copyrightWithoutNewLine1.types index d54f9fae4d927..bdb9bd0e44db2 100644 --- a/tests/baselines/reference/copyrightWithoutNewLine1.types +++ b/tests/baselines/reference/copyrightWithoutNewLine1.types @@ -6,11 +6,11 @@ import model = require("./greeter") >model : any var el = document.getElementById('content'); ->el : any ->document.getElementById('content') : any ->document.getElementById : any ->document : any ->getElementById : any +>el : HTMLElement +>document.getElementById('content') : HTMLElement +>document.getElementById : (elementId: string) => HTMLElement +>document : Document +>getElementById : (elementId: string) => HTMLElement >'content' : "content" var greeter = new model.Greeter(el); @@ -19,7 +19,7 @@ var greeter = new model.Greeter(el); >model.Greeter : any >model : any >Greeter : any ->el : any +>el : HTMLElement /** things */ greeter.start(); diff --git a/tests/baselines/reference/covariantCallbacks.symbols b/tests/baselines/reference/covariantCallbacks.symbols index 5e1325de3ec90..d29948e171946 100644 --- a/tests/baselines/reference/covariantCallbacks.symbols +++ b/tests/baselines/reference/covariantCallbacks.symbols @@ -43,10 +43,10 @@ function f1(a: P, b: P) { function f2(a: Promise, b: Promise) { >f2 : Symbol(f2, Decl(covariantCallbacks.ts, 12, 1)) >a : Symbol(a, Decl(covariantCallbacks.ts, 14, 12)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >A : Symbol(A, Decl(covariantCallbacks.ts, 4, 2)) >b : Symbol(b, Decl(covariantCallbacks.ts, 14, 26)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >B : Symbol(B, Decl(covariantCallbacks.ts, 6, 25)) a = b; diff --git a/tests/baselines/reference/customEventDetail.errors.txt b/tests/baselines/reference/customEventDetail.errors.txt deleted file mode 100644 index f243dc64c3414..0000000000000 --- a/tests/baselines/reference/customEventDetail.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -tests/cases/compiler/customEventDetail.ts(1,8): error TS2304: Cannot find name 'CustomEvent'. - - -==== tests/cases/compiler/customEventDetail.ts (1 errors) ==== - var x: CustomEvent; - ~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'CustomEvent'. - - // valid since detail is any - x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); - var y = x.detail.name; \ No newline at end of file diff --git a/tests/baselines/reference/customEventDetail.symbols b/tests/baselines/reference/customEventDetail.symbols index 7bdce2e92f026..4c543d6eb0e5a 100644 --- a/tests/baselines/reference/customEventDetail.symbols +++ b/tests/baselines/reference/customEventDetail.symbols @@ -1,14 +1,19 @@ === tests/cases/compiler/customEventDetail.ts === var x: CustomEvent; >x : Symbol(x, Decl(customEventDetail.ts, 0, 3)) +>CustomEvent : Symbol(CustomEvent, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // valid since detail is any x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); +>x.initCustomEvent : Symbol(CustomEvent.initCustomEvent, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(customEventDetail.ts, 0, 3)) +>initCustomEvent : Symbol(CustomEvent.initCustomEvent, Decl(lib.d.ts, --, --)) >id : Symbol(id, Decl(customEventDetail.ts, 3, 40)) >name : Symbol(name, Decl(customEventDetail.ts, 3, 48)) var y = x.detail.name; >y : Symbol(y, Decl(customEventDetail.ts, 4, 3)) +>x.detail : Symbol(CustomEvent.detail, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(customEventDetail.ts, 0, 3)) +>detail : Symbol(CustomEvent.detail, Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/customEventDetail.types b/tests/baselines/reference/customEventDetail.types index 2a32ae0e13b81..c7e1ffd2128fe 100644 --- a/tests/baselines/reference/customEventDetail.types +++ b/tests/baselines/reference/customEventDetail.types @@ -1,14 +1,14 @@ === tests/cases/compiler/customEventDetail.ts === var x: CustomEvent; ->x : any ->CustomEvent : No type information available! +>x : CustomEvent +>CustomEvent : CustomEvent // valid since detail is any x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }); ->x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }) : any ->x.initCustomEvent : any ->x : any ->initCustomEvent : any +>x.initCustomEvent('hello', true, true, { id: 12, name: 'hello' }) : void +>x.initCustomEvent : (typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any) => void +>x : CustomEvent +>initCustomEvent : (typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: any) => void >'hello' : "hello" >true : true >true : true @@ -22,7 +22,7 @@ var y = x.detail.name; >y : any >x.detail.name : any >x.detail : any ->x : any +>x : CustomEvent >detail : any >name : any diff --git a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols index 168971f364f51..1dc33ab33252e 100644 --- a/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols +++ b/tests/baselines/reference/declFileTypeAnnotationTypeAlias.symbols @@ -36,7 +36,7 @@ module M { } interface Window { ->Window : Symbol(Window, Decl(declFileTypeAnnotationTypeAlias.ts, 17, 1)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(declFileTypeAnnotationTypeAlias.ts, 17, 1)) someMethod(); >someMethod : Symbol(Window.someMethod, Decl(declFileTypeAnnotationTypeAlias.ts, 19, 18)) @@ -47,7 +47,7 @@ module M { export type W = Window | string; >W : Symbol(W, Decl(declFileTypeAnnotationTypeAlias.ts, 23, 10)) ->Window : Symbol(Window, Decl(declFileTypeAnnotationTypeAlias.ts, 17, 1)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(declFileTypeAnnotationTypeAlias.ts, 17, 1)) export module N { >N : Symbol(N, Decl(declFileTypeAnnotationTypeAlias.ts, 24, 36)) diff --git a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.symbols b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.symbols index 69a55a72c0ea7..75c71d0e7c3f3 100644 --- a/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.symbols +++ b/tests/baselines/reference/declFileTypeAnnotationVisibilityErrorTypeAlias.symbols @@ -1,6 +1,6 @@ === tests/cases/compiler/declFileTypeAnnotationVisibilityErrorTypeAlias.ts === interface Window { ->Window : Symbol(Window, Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 0, 0)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 0, 0)) someMethod(); >someMethod : Symbol(Window.someMethod, Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 0, 18)) @@ -11,7 +11,7 @@ module M { type W = Window | string; >W : Symbol(W, Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 4, 10)) ->Window : Symbol(Window, Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 0, 0)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 0, 0)) export module N { >N : Symbol(N, Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 5, 29)) @@ -30,7 +30,7 @@ module M1 { export type W = Window | string; >W : Symbol(W, Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 12, 11)) ->Window : Symbol(Window, Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 0, 0)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 0, 0)) export module N { >N : Symbol(N, Decl(declFileTypeAnnotationVisibilityErrorTypeAlias.ts, 13, 36)) diff --git a/tests/baselines/reference/declarationEmitPromise.symbols b/tests/baselines/reference/declarationEmitPromise.symbols index 2e9185d2e3997..71a31bea4698b 100644 --- a/tests/baselines/reference/declarationEmitPromise.symbols +++ b/tests/baselines/reference/declarationEmitPromise.symbols @@ -5,7 +5,7 @@ export class bluebird { static all: Array>; >all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >bluebird : Symbol(bluebird, Decl(declarationEmitPromise.ts, 0, 0)) } @@ -39,13 +39,13 @@ export async function runSampleWorks( >bluebird.all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26)) >bluebird : Symbol(bluebird, Decl(declarationEmitPromise.ts, 0, 0)) >all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26)) ->[a, b, c, d, e].filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>[a, b, c, d, e].filter : Symbol(Array.filter, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(declarationEmitPromise.ts, 4, 52)) >b : Symbol(b, Decl(declarationEmitPromise.ts, 5, 19)) >c : Symbol(c, Decl(declarationEmitPromise.ts, 5, 36)) >d : Symbol(d, Decl(declarationEmitPromise.ts, 5, 53)) >e : Symbol(e, Decl(declarationEmitPromise.ts, 5, 70)) ->filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>filter : Symbol(Array.filter, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >el : Symbol(el, Decl(declarationEmitPromise.ts, 6, 68)) >el : Symbol(el, Decl(declarationEmitPromise.ts, 6, 68)) @@ -67,9 +67,9 @@ export async function runSampleWorks( >T : Symbol(T, Decl(declarationEmitPromise.ts, 7, 16)) f.apply(this, result); ->f.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>f.apply : Symbol(Function.apply, Decl(lib.es6.d.ts, --, --)) >f : Symbol(f, Decl(declarationEmitPromise.ts, 7, 19)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(Function.apply, Decl(lib.es6.d.ts, --, --)) >result : Symbol(result, Decl(declarationEmitPromise.ts, 6, 7)) let rfunc: typeof func & {} = func as any; // <- This is the only difference @@ -111,13 +111,13 @@ export async function runSampleBreaks( >bluebird.all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26)) >bluebird : Symbol(bluebird, Decl(declarationEmitPromise.ts, 0, 0)) >all : Symbol(bluebird.all, Decl(declarationEmitPromise.ts, 0, 26)) ->[a, b, c, d, e].filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>[a, b, c, d, e].filter : Symbol(Array.filter, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(declarationEmitPromise.ts, 13, 53)) >b : Symbol(b, Decl(declarationEmitPromise.ts, 14, 19)) >c : Symbol(c, Decl(declarationEmitPromise.ts, 14, 36)) >d : Symbol(d, Decl(declarationEmitPromise.ts, 14, 53)) >e : Symbol(e, Decl(declarationEmitPromise.ts, 14, 70)) ->filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>filter : Symbol(Array.filter, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >el : Symbol(el, Decl(declarationEmitPromise.ts, 15, 68)) >el : Symbol(el, Decl(declarationEmitPromise.ts, 15, 68)) @@ -139,9 +139,9 @@ export async function runSampleBreaks( >T : Symbol(T, Decl(declarationEmitPromise.ts, 16, 16)) f.apply(this, result); ->f.apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>f.apply : Symbol(Function.apply, Decl(lib.es6.d.ts, --, --)) >f : Symbol(f, Decl(declarationEmitPromise.ts, 16, 19)) ->apply : Symbol(Function.apply, Decl(lib.es5.d.ts, --, --)) +>apply : Symbol(Function.apply, Decl(lib.es6.d.ts, --, --)) >result : Symbol(result, Decl(declarationEmitPromise.ts, 15, 7)) let rfunc: typeof func = func as any; // <- This is the only difference diff --git a/tests/baselines/reference/declarationFiles.symbols b/tests/baselines/reference/declarationFiles.symbols index e45b01d58dc6b..d8623676e494c 100644 --- a/tests/baselines/reference/declarationFiles.symbols +++ b/tests/baselines/reference/declarationFiles.symbols @@ -44,11 +44,11 @@ class C3 { c: this | Date; >c : Symbol(C3.c, Decl(declarationFiles.ts, 17, 20)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) d: this & Date; >d : Symbol(C3.d, Decl(declarationFiles.ts, 18, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) e: (((this))); >e : Symbol(C3.e, Decl(declarationFiles.ts, 19, 19)) diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedAmd.symbols b/tests/baselines/reference/decoratedDefaultExportsGetExportedAmd.symbols index 3e7ec56892711..829635323dd5b 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedAmd.symbols +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedAmd.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/moduleExportsAmd/a.ts === var decorator: ClassDecorator; >decorator : Symbol(decorator, Decl(a.ts, 0, 3)) ->ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(a.ts, 0, 3)) @@ -12,7 +12,7 @@ export default class Foo {} === tests/cases/conformance/es6/moduleExportsAmd/b.ts === var decorator: ClassDecorator; >decorator : Symbol(decorator, Decl(b.ts, 0, 3)) ->ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(b.ts, 0, 3)) diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedCommonjs.symbols b/tests/baselines/reference/decoratedDefaultExportsGetExportedCommonjs.symbols index 383d7d2c0d2f2..a65cf169cbc0b 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedCommonjs.symbols +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedCommonjs.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/moduleExportsCommonjs/a.ts === var decorator: ClassDecorator; >decorator : Symbol(decorator, Decl(a.ts, 0, 3)) ->ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(a.ts, 0, 3)) @@ -12,7 +12,7 @@ export default class Foo {} === tests/cases/conformance/es6/moduleExportsCommonjs/b.ts === var decorator: ClassDecorator; >decorator : Symbol(decorator, Decl(b.ts, 0, 3)) ->ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(b.ts, 0, 3)) diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.symbols b/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.symbols index 73898da76c41a..7358191e399dc 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.symbols +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedSystem.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/moduleExportsSystem/a.ts === var decorator: ClassDecorator; >decorator : Symbol(decorator, Decl(a.ts, 0, 3)) ->ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(a.ts, 0, 3)) @@ -12,7 +12,7 @@ export default class Foo {} === tests/cases/conformance/es6/moduleExportsSystem/b.ts === var decorator: ClassDecorator; >decorator : Symbol(decorator, Decl(b.ts, 0, 3)) ->ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(b.ts, 0, 3)) diff --git a/tests/baselines/reference/decoratedDefaultExportsGetExportedUmd.symbols b/tests/baselines/reference/decoratedDefaultExportsGetExportedUmd.symbols index f93e5411306d7..1bc810409af43 100644 --- a/tests/baselines/reference/decoratedDefaultExportsGetExportedUmd.symbols +++ b/tests/baselines/reference/decoratedDefaultExportsGetExportedUmd.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/moduleExportsUmd/a.ts === var decorator: ClassDecorator; >decorator : Symbol(decorator, Decl(a.ts, 0, 3)) ->ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(a.ts, 0, 3)) @@ -12,7 +12,7 @@ export default class Foo {} === tests/cases/conformance/es6/moduleExportsUmd/b.ts === var decorator: ClassDecorator; >decorator : Symbol(decorator, Decl(b.ts, 0, 3)) ->ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(b.ts, 0, 3)) diff --git a/tests/baselines/reference/decoratorMetadataPromise.symbols b/tests/baselines/reference/decoratorMetadataPromise.symbols index 4ec97538aa51e..a40c240b38bfc 100644 --- a/tests/baselines/reference/decoratorMetadataPromise.symbols +++ b/tests/baselines/reference/decoratorMetadataPromise.symbols @@ -1,7 +1,7 @@ === tests/cases/compiler/decoratorMetadataPromise.ts === declare const decorator: MethodDecorator; >decorator : Symbol(decorator, Decl(decoratorMetadataPromise.ts, 0, 13)) ->MethodDecorator : Symbol(MethodDecorator, Decl(lib.es5.d.ts, --, --)) +>MethodDecorator : Symbol(MethodDecorator, Decl(lib.es6.d.ts, --, --)) class A { >A : Symbol(A, Decl(decoratorMetadataPromise.ts, 0, 41)) @@ -17,7 +17,7 @@ class A { async bar(): Promise { return 0; } >bar : Symbol(A.bar, Decl(decoratorMetadataPromise.ts, 4, 18)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) @decorator >decorator : Symbol(decorator, Decl(decoratorMetadataPromise.ts, 0, 13)) @@ -25,8 +25,8 @@ class A { baz(n: Promise): Promise { return n; } >baz : Symbol(A.baz, Decl(decoratorMetadataPromise.ts, 6, 46)) >n : Symbol(n, Decl(decoratorMetadataPromise.ts, 8, 8)) ->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, --, --)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(decoratorMetadataPromise.ts, 8, 8)) } diff --git a/tests/baselines/reference/decoratorOnClassAccessor1.es6.symbols b/tests/baselines/reference/decoratorOnClassAccessor1.es6.symbols index 82fe1128adab6..62b7f821c213f 100644 --- a/tests/baselines/reference/decoratorOnClassAccessor1.es6.symbols +++ b/tests/baselines/reference/decoratorOnClassAccessor1.es6.symbols @@ -5,9 +5,9 @@ declare function dec(target: any, propertyKey: string, descriptor: TypedPrope >target : Symbol(target, Decl(decoratorOnClassAccessor1.es6.ts, 0, 24)) >propertyKey : Symbol(propertyKey, Decl(decoratorOnClassAccessor1.es6.ts, 0, 36)) >descriptor : Symbol(descriptor, Decl(decoratorOnClassAccessor1.es6.ts, 0, 57)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassAccessor1.es6.ts, 0, 21)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassAccessor1.es6.ts, 0, 21)) export default class { diff --git a/tests/baselines/reference/decoratorOnClassMethod1.es6.symbols b/tests/baselines/reference/decoratorOnClassMethod1.es6.symbols index 1e7707c5329e2..e57dcbaef5497 100644 --- a/tests/baselines/reference/decoratorOnClassMethod1.es6.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod1.es6.symbols @@ -5,9 +5,9 @@ declare function dec(target: any, propertyKey: string, descriptor: TypedPrope >target : Symbol(target, Decl(decoratorOnClassMethod1.es6.ts, 0, 24)) >propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod1.es6.ts, 0, 36)) >descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod1.es6.ts, 0, 57)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod1.es6.ts, 0, 21)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod1.es6.ts, 0, 21)) export default class { diff --git a/tests/baselines/reference/decoratorOnClassMethod13.symbols b/tests/baselines/reference/decoratorOnClassMethod13.symbols index 7cd369be14421..2375932fbf117 100644 --- a/tests/baselines/reference/decoratorOnClassMethod13.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod13.symbols @@ -5,9 +5,9 @@ declare function dec(target: any, propertyKey: string, descriptor: TypedPrope >target : Symbol(target, Decl(decoratorOnClassMethod13.ts, 0, 24)) >propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod13.ts, 0, 36)) >descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod13.ts, 0, 57)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod13.ts, 0, 21)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod13.ts, 0, 21)) class C { diff --git a/tests/baselines/reference/decoratorOnClassMethod4.symbols b/tests/baselines/reference/decoratorOnClassMethod4.symbols index da0e9eafca7f6..c8c48aa2e4dd9 100644 --- a/tests/baselines/reference/decoratorOnClassMethod4.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod4.symbols @@ -5,9 +5,9 @@ declare function dec(target: any, propertyKey: string, descriptor: TypedPrope >target : Symbol(target, Decl(decoratorOnClassMethod4.ts, 0, 24)) >propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod4.ts, 0, 36)) >descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod4.ts, 0, 57)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod4.ts, 0, 21)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod4.ts, 0, 21)) class C { diff --git a/tests/baselines/reference/decoratorOnClassMethod5.symbols b/tests/baselines/reference/decoratorOnClassMethod5.symbols index bd895deeea808..fa523888fc45b 100644 --- a/tests/baselines/reference/decoratorOnClassMethod5.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod5.symbols @@ -5,9 +5,9 @@ declare function dec(): (target: any, propertyKey: string, descriptor: TypedP >target : Symbol(target, Decl(decoratorOnClassMethod5.ts, 0, 28)) >propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod5.ts, 0, 40)) >descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod5.ts, 0, 61)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod5.ts, 0, 25)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod5.ts, 0, 25)) class C { diff --git a/tests/baselines/reference/decoratorOnClassMethod6.symbols b/tests/baselines/reference/decoratorOnClassMethod6.symbols index 6391192ece3de..85f81d39af2fc 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod6.symbols @@ -5,9 +5,9 @@ declare function dec(): (target: any, propertyKey: string, descriptor: TypedP >target : Symbol(target, Decl(decoratorOnClassMethod6.ts, 0, 28)) >propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod6.ts, 0, 40)) >descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod6.ts, 0, 61)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod6.ts, 0, 25)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod6.ts, 0, 25)) class C { diff --git a/tests/baselines/reference/decoratorOnClassMethod7.symbols b/tests/baselines/reference/decoratorOnClassMethod7.symbols index 9ec0de0c205f9..bfdedcf023029 100644 --- a/tests/baselines/reference/decoratorOnClassMethod7.symbols +++ b/tests/baselines/reference/decoratorOnClassMethod7.symbols @@ -5,9 +5,9 @@ declare function dec(target: any, propertyKey: string, descriptor: TypedPrope >target : Symbol(target, Decl(decoratorOnClassMethod7.ts, 0, 24)) >propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethod7.ts, 0, 36)) >descriptor : Symbol(descriptor, Decl(decoratorOnClassMethod7.ts, 0, 57)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod7.ts, 0, 21)) ->TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es5.d.ts, --, --)) +>TypedPropertyDescriptor : Symbol(TypedPropertyDescriptor, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(decoratorOnClassMethod7.ts, 0, 21)) class C { diff --git a/tests/baselines/reference/decoratorOnClassMethodParameter1.es6.symbols b/tests/baselines/reference/decoratorOnClassMethodParameter1.es6.symbols index aee56f5a4f84f..241d71d02d4b2 100644 --- a/tests/baselines/reference/decoratorOnClassMethodParameter1.es6.symbols +++ b/tests/baselines/reference/decoratorOnClassMethodParameter1.es6.symbols @@ -2,7 +2,7 @@ declare function dec(target: Object, propertyKey: string | symbol, parameterIndex: number): void; >dec : Symbol(dec, Decl(decoratorOnClassMethodParameter1.es6.ts, 0, 0)) >target : Symbol(target, Decl(decoratorOnClassMethodParameter1.es6.ts, 0, 21)) ->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >propertyKey : Symbol(propertyKey, Decl(decoratorOnClassMethodParameter1.es6.ts, 0, 36)) >parameterIndex : Symbol(parameterIndex, Decl(decoratorOnClassMethodParameter1.es6.ts, 0, 66)) diff --git a/tests/baselines/reference/decoratorWithUnderscoreMethod.symbols b/tests/baselines/reference/decoratorWithUnderscoreMethod.symbols index b9c7be21514be..5736020994261 100644 --- a/tests/baselines/reference/decoratorWithUnderscoreMethod.symbols +++ b/tests/baselines/reference/decoratorWithUnderscoreMethod.symbols @@ -6,13 +6,13 @@ declare var console : { log(arg: string): void }; function dec(): Function { >dec : Symbol(dec, Decl(decoratorWithUnderscoreMethod.ts, 0, 49)) ->Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) return function (target: any, propKey: string, descr: PropertyDescriptor): void { >target : Symbol(target, Decl(decoratorWithUnderscoreMethod.ts, 2, 21)) >propKey : Symbol(propKey, Decl(decoratorWithUnderscoreMethod.ts, 2, 33)) >descr : Symbol(descr, Decl(decoratorWithUnderscoreMethod.ts, 2, 50)) ->PropertyDescriptor : Symbol(PropertyDescriptor, Decl(lib.d.ts, --, --)) +>PropertyDescriptor : Symbol(PropertyDescriptor, Decl(lib.es5.d.ts, --, --)) console.log(target[propKey]); >console.log : Symbol(log, Decl(decoratorWithUnderscoreMethod.ts, 0, 23)) diff --git a/tests/baselines/reference/decoratorsOnComputedProperties.symbols b/tests/baselines/reference/decoratorsOnComputedProperties.symbols index a9fb280f96ed1..614a18b82bd7a 100644 --- a/tests/baselines/reference/decoratorsOnComputedProperties.symbols +++ b/tests/baselines/reference/decoratorsOnComputedProperties.symbols @@ -3,7 +3,7 @@ function x(o: object, k: PropertyKey) { } >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) >o : Symbol(o, Decl(decoratorsOnComputedProperties.ts, 0, 11)) >k : Symbol(k, Decl(decoratorsOnComputedProperties.ts, 0, 21)) ->PropertyKey : Symbol(PropertyKey, Decl(lib.es2015.core.d.ts, --, --)) +>PropertyKey : Symbol(PropertyKey, Decl(lib.es6.d.ts, --, --)) let i = 0; >i : Symbol(i, Decl(decoratorsOnComputedProperties.ts, 1, 3)) @@ -30,9 +30,9 @@ class A { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -40,25 +40,25 @@ class A { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(A[["property3"]], Decl(decoratorsOnComputedProperties.ts, 12, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(A[["property4"]], Decl(decoratorsOnComputedProperties.ts, 14, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -92,9 +92,9 @@ void class B { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -102,25 +102,25 @@ void class B { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(B[["property3"]], Decl(decoratorsOnComputedProperties.ts, 29, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(B[["property4"]], Decl(decoratorsOnComputedProperties.ts, 31, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -155,9 +155,9 @@ class C { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -165,25 +165,25 @@ class C { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(C[["property3"]], Decl(decoratorsOnComputedProperties.ts, 46, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(C[["property4"]], Decl(decoratorsOnComputedProperties.ts, 48, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -219,9 +219,9 @@ void class D { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -229,25 +229,25 @@ void class D { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(D[["property3"]], Decl(decoratorsOnComputedProperties.ts, 64, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(D[["property4"]], Decl(decoratorsOnComputedProperties.ts, 66, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -283,9 +283,9 @@ class E { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -293,25 +293,25 @@ class E { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(E[["property3"]], Decl(decoratorsOnComputedProperties.ts, 82, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(E[["property4"]], Decl(decoratorsOnComputedProperties.ts, 84, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -346,9 +346,9 @@ void class F { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -356,25 +356,25 @@ void class F { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(F[["property3"]], Decl(decoratorsOnComputedProperties.ts, 100, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(F[["property4"]], Decl(decoratorsOnComputedProperties.ts, 102, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -410,9 +410,9 @@ class G { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -420,25 +420,25 @@ class G { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(G[["property3"]], Decl(decoratorsOnComputedProperties.ts, 118, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(G[["property4"]], Decl(decoratorsOnComputedProperties.ts, 120, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -474,9 +474,9 @@ void class H { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -484,25 +484,25 @@ void class H { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(H[["property3"]], Decl(decoratorsOnComputedProperties.ts, 137, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(H[["property4"]], Decl(decoratorsOnComputedProperties.ts, 139, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -539,9 +539,9 @@ class I { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -549,25 +549,25 @@ class I { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(I[["property3"]], Decl(decoratorsOnComputedProperties.ts, 156, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(I[["property4"]], Decl(decoratorsOnComputedProperties.ts, 158, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) @@ -605,9 +605,9 @@ void class J { @x [Symbol.toStringTag]: any; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) @x ["property2"]: any = 2; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) @@ -615,25 +615,25 @@ void class J { @x [Symbol.iterator]: any = null; >x : Symbol(x, Decl(decoratorsOnComputedProperties.ts, 0, 0)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) ["property3"]: any; >"property3" : Symbol(J[["property3"]], Decl(decoratorsOnComputedProperties.ts, 175, 37)) [Symbol.isConcatSpreadable]: any; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) ["property4"]: any = 2; >"property4" : Symbol(J[["property4"]], Decl(decoratorsOnComputedProperties.ts, 177, 37)) [Symbol.match]: any = null; ->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, --, --)) +>Symbol.match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>match : Symbol(SymbolConstructor.match, Decl(lib.es6.d.ts, --, --)) [foo()]: any; >foo : Symbol(foo, Decl(decoratorsOnComputedProperties.ts, 1, 10)) diff --git a/tests/baselines/reference/deduplicateImportsInSystem.errors.txt b/tests/baselines/reference/deduplicateImportsInSystem.errors.txt index d1bfe88160e59..3ce3f88c81786 100644 --- a/tests/baselines/reference/deduplicateImportsInSystem.errors.txt +++ b/tests/baselines/reference/deduplicateImportsInSystem.errors.txt @@ -4,10 +4,9 @@ tests/cases/compiler/deduplicateImportsInSystem.ts(3,17): error TS2307: Cannot f tests/cases/compiler/deduplicateImportsInSystem.ts(4,17): error TS2307: Cannot find module 'f2'. tests/cases/compiler/deduplicateImportsInSystem.ts(5,17): error TS2307: Cannot find module 'f2'. tests/cases/compiler/deduplicateImportsInSystem.ts(6,17): error TS2307: Cannot find module 'f1'. -tests/cases/compiler/deduplicateImportsInSystem.ts(8,1): error TS2304: Cannot find name 'console'. -==== tests/cases/compiler/deduplicateImportsInSystem.ts (7 errors) ==== +==== tests/cases/compiler/deduplicateImportsInSystem.ts (6 errors) ==== import {A} from "f1"; ~~~~ !!! error TS2307: Cannot find module 'f1'. @@ -27,6 +26,4 @@ tests/cases/compiler/deduplicateImportsInSystem.ts(8,1): error TS2304: Cannot fi ~~~~ !!! error TS2307: Cannot find module 'f1'. - console.log(A + B + C + D + E + F) - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. \ No newline at end of file + console.log(A + B + C + D + E + F) \ No newline at end of file diff --git a/tests/baselines/reference/deduplicateImportsInSystem.symbols b/tests/baselines/reference/deduplicateImportsInSystem.symbols index 3627df789db79..93a4723a2b126 100644 --- a/tests/baselines/reference/deduplicateImportsInSystem.symbols +++ b/tests/baselines/reference/deduplicateImportsInSystem.symbols @@ -18,6 +18,9 @@ import {F} from 'f1'; >F : Symbol(F, Decl(deduplicateImportsInSystem.ts, 5, 8)) console.log(A + B + C + D + E + F) +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >A : Symbol(A, Decl(deduplicateImportsInSystem.ts, 0, 8)) >B : Symbol(B, Decl(deduplicateImportsInSystem.ts, 1, 8)) >C : Symbol(C, Decl(deduplicateImportsInSystem.ts, 2, 8)) diff --git a/tests/baselines/reference/deduplicateImportsInSystem.types b/tests/baselines/reference/deduplicateImportsInSystem.types index 07bfeb48639d0..8a0eb6430b4ab 100644 --- a/tests/baselines/reference/deduplicateImportsInSystem.types +++ b/tests/baselines/reference/deduplicateImportsInSystem.types @@ -18,10 +18,10 @@ import {F} from 'f1'; >F : any console.log(A + B + C + D + E + F) ->console.log(A + B + C + D + E + F) : any ->console.log : any ->console : any ->log : any +>console.log(A + B + C + D + E + F) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >A + B + C + D + E + F : any >A + B + C + D + E : any >A + B + C + D : any diff --git a/tests/baselines/reference/defaultExportInAwaitExpression01.symbols b/tests/baselines/reference/defaultExportInAwaitExpression01.symbols index 2741f624cff07..ed135aa28ea58 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression01.symbols +++ b/tests/baselines/reference/defaultExportInAwaitExpression01.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/modules/a.ts === const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); >x : Symbol(x, Decl(a.ts, 0, 5)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >resolve : Symbol(resolve, Decl(a.ts, 0, 24)) >reject : Symbol(reject, Decl(a.ts, 0, 33)) >resolve : Symbol(resolve, Decl(a.ts, 0, 24)) diff --git a/tests/baselines/reference/defaultExportInAwaitExpression02.symbols b/tests/baselines/reference/defaultExportInAwaitExpression02.symbols index 2741f624cff07..ed135aa28ea58 100644 --- a/tests/baselines/reference/defaultExportInAwaitExpression02.symbols +++ b/tests/baselines/reference/defaultExportInAwaitExpression02.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/modules/a.ts === const x = new Promise( ( resolve, reject ) => { resolve( {} ); } ); >x : Symbol(x, Decl(a.ts, 0, 5)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >resolve : Symbol(resolve, Decl(a.ts, 0, 24)) >reject : Symbol(reject, Decl(a.ts, 0, 33)) >resolve : Symbol(resolve, Decl(a.ts, 0, 24)) diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.symbols b/tests/baselines/reference/derivedClassIncludesInheritedMembers.symbols index 6cbc7a28707dd..1b9fcb27ea8c6 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.symbols +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.symbols @@ -97,7 +97,7 @@ class Base2 { [x: number]: Date; >x : Symbol(x, Decl(derivedClassIncludesInheritedMembers.ts, 29, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } class Derived2 extends Base2 { diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.symbols b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.symbols index 4340247ea88cb..32b4e16d942c0 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.symbols +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.symbols @@ -52,7 +52,7 @@ class Base2 { class D extends Base2 { >D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor.ts, 16, 1)) >T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor.ts, 18, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Base2 : Symbol(Base2, Decl(derivedClassWithoutExplicitConstructor.ts, 11, 24)) >T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor.ts, 18, 8)) @@ -71,5 +71,5 @@ var d = new D(); // error var d2 = new D(new Date()); // ok >d2 : Symbol(d2, Decl(derivedClassWithoutExplicitConstructor.ts, 24, 3)) >D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor.ts, 16, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.symbols b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.symbols index 0169094f97f5c..a6e3be7da9501 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.symbols +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.symbols @@ -83,7 +83,7 @@ class Base2 { class D extends Base2 { >D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1)) >T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 24, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Base2 : Symbol(Base2, Decl(derivedClassWithoutExplicitConstructor2.ts, 15, 30)) >T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor2.ts, 24, 8)) @@ -102,18 +102,18 @@ var d = new D(); // error var d2 = new D(new Date()); // ok >d2 : Symbol(d2, Decl(derivedClassWithoutExplicitConstructor2.ts, 30, 3)) >D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var d3 = new D(new Date(), new Date()); >d3 : Symbol(d3, Decl(derivedClassWithoutExplicitConstructor2.ts, 31, 3)) >D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var d4 = new D(new Date(), new Date(), new Date()); >d4 : Symbol(d4, Decl(derivedClassWithoutExplicitConstructor2.ts, 32, 3)) >D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor2.ts, 22, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.symbols b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.symbols index d4cb0fb3b752f..55e0c706427fa 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.symbols +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.symbols @@ -107,7 +107,7 @@ class D extends Base { class D2 extends D { >D2 : Symbol(D2, Decl(derivedClassWithoutExplicitConstructor3.ts, 35, 1)) >T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor3.ts, 38, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >D : Symbol(D, Decl(derivedClassWithoutExplicitConstructor3.ts, 27, 1)) >T : Symbol(T, Decl(derivedClassWithoutExplicitConstructor3.ts, 38, 9)) @@ -126,11 +126,11 @@ var d = new D2(); // error var d2 = new D2(new Date()); // error >d2 : Symbol(d2, Decl(derivedClassWithoutExplicitConstructor3.ts, 44, 3)) >D2 : Symbol(D2, Decl(derivedClassWithoutExplicitConstructor3.ts, 35, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var d3 = new D2(new Date(), new Date()); // ok >d3 : Symbol(d3, Decl(derivedClassWithoutExplicitConstructor3.ts, 45, 3)) >D2 : Symbol(D2, Decl(derivedClassWithoutExplicitConstructor3.ts, 35, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5.symbols b/tests/baselines/reference/destructuringParameterDeclaration3ES5.symbols index 3019439df542c..d34aff8819690 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5.symbols +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5.symbols @@ -7,19 +7,19 @@ type arrayString = Array >arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5.ts, 0, 0)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->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) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) type someArray = Array | number[]; >someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES5.ts, 6, 32)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->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) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) type stringOrNumArray = Array; >stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5.ts, 7, 42)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->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) ->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) +>Number : Symbol(Number, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) function a1(...x: (number|string)[]) { } >a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES5.ts, 8, 45)) @@ -32,8 +32,8 @@ function a2(...a) { } function a3(...a: Array) { } >a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES5.ts, 11, 21)) >a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 12, 12)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->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) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) function a4(...a: arrayString) { } >a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES5.ts, 12, 36)) @@ -121,7 +121,7 @@ const enum E1 { a, b } function foo1(...a: T[]) { } >foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5.ts, 38, 22)) >T : Symbol(T, Decl(destructuringParameterDeclaration3ES5.ts, 39, 14)) ->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(destructuringParameterDeclaration3ES5.ts, 39, 32)) >T : Symbol(T, Decl(destructuringParameterDeclaration3ES5.ts, 39, 14)) diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES6.symbols b/tests/baselines/reference/destructuringParameterDeclaration3ES6.symbols index 343febeee34a1..5656fb335971a 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES6.symbols +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES6.symbols @@ -7,19 +7,19 @@ type arrayString = Array >arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES6.ts, 0, 0)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->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) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) type someArray = Array | number[]; >someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES6.ts, 6, 32)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->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) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) type stringOrNumArray = Array; >stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES6.ts, 7, 42)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->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) ->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) +>Number : Symbol(Number, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) function a1(...x: (number|string)[]) { } >a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES6.ts, 8, 45)) @@ -32,8 +32,8 @@ function a2(...a) { } function a3(...a: Array) { } >a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES6.ts, 11, 21)) >a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 12, 12)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->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) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) function a4(...a: arrayString) { } >a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES6.ts, 12, 36)) @@ -121,7 +121,7 @@ const enum E1 { a, b } function foo1(...a: T[]) { } >foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES6.ts, 38, 22)) >T : Symbol(T, Decl(destructuringParameterDeclaration3ES6.ts, 39, 14)) ->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(destructuringParameterDeclaration3ES6.ts, 39, 32)) >T : Symbol(T, Decl(destructuringParameterDeclaration3ES6.ts, 39, 14)) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols index af88159a9a40c..d99227adb5fd8 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments14_ES6.symbols @@ -3,9 +3,9 @@ function f() { >f : Symbol(f, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 0, 0)) if (Math.random()) { ->Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math.random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) let arguments = 100; >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments14_ES6.ts, 2, 11)) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols index b87f113f7b289..14618f76ba10f 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments15_ES6.symbols @@ -6,9 +6,9 @@ function f() { >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 1, 7)) if (Math.random()) { ->Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math.random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) const arguments = 100; >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments15_ES6.ts, 3, 13)) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols index 3cc31438f74fa..077fde35fc543 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments16_ES6.symbols @@ -6,9 +6,9 @@ function f() { >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 1, 7), Decl(emitArrowFunctionWhenUsingArguments16_ES6.ts, 5, 7)) if (Math.random()) { ->Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math.random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) return () => arguments[0]; >arguments : Symbol(arguments) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols index ecf7c9ba46ace..f610cdbac256d 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments17_ES6.symbols @@ -7,9 +7,9 @@ function f() { >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments17_ES6.ts, 1, 25)) if (Math.random()) { ->Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math.random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) return () => arguments[0]; >arguments : Symbol(arguments) diff --git a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols index a10372c15d84c..4599fdf9a6abc 100644 --- a/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols +++ b/tests/baselines/reference/emitArrowFunctionWhenUsingArguments18_ES6.symbols @@ -8,9 +8,9 @@ function f() { >arguments : Symbol(arguments, Decl(emitArrowFunctionWhenUsingArguments18_ES6.ts, 1, 31)) if (Math.random()) { ->Math.random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->random : Symbol(Math.random, Decl(lib.es5.d.ts, --, --)) +>Math.random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>random : Symbol(Math.random, Decl(lib.es6.d.ts, --, --)) return () => arguments; >arguments : Symbol(arguments) diff --git a/tests/baselines/reference/enumAssignability.symbols b/tests/baselines/reference/enumAssignability.symbols index f99dc85569e44..b840b7addb053 100644 --- a/tests/baselines/reference/enumAssignability.symbols +++ b/tests/baselines/reference/enumAssignability.symbols @@ -84,7 +84,7 @@ module Others { var ee: Date = e; >ee : Symbol(ee, Decl(enumAssignability.ts, 30, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >e : Symbol(e, Decl(enumAssignability.ts, 5, 3)) var f: any = e; // ok @@ -159,7 +159,7 @@ module Others { >U : Symbol(U, Decl(enumAssignability.ts, 46, 19)) >T : Symbol(T, Decl(enumAssignability.ts, 46, 17)) >V : Symbol(V, Decl(enumAssignability.ts, 46, 32)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >A : Symbol(A, Decl(enumAssignability.ts, 46, 48)) >Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >B : Symbol(B, Decl(enumAssignability.ts, 46, 66)) diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.symbols b/tests/baselines/reference/enumAssignabilityInInheritance.symbols index 55071f3e14c33..9d234c7962261 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.symbols +++ b/tests/baselines/reference/enumAssignabilityInInheritance.symbols @@ -85,8 +85,8 @@ var r4 = foo3(E.A); declare function foo4(x: Date): Date; >foo4 : Symbol(foo4, Decl(enumAssignabilityInInheritance.ts, 26, 19), Decl(enumAssignabilityInInheritance.ts, 28, 37)) >x : Symbol(x, Decl(enumAssignabilityInInheritance.ts, 28, 22)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) declare function foo4(x: E): E; >foo4 : Symbol(foo4, Decl(enumAssignabilityInInheritance.ts, 26, 19), Decl(enumAssignabilityInInheritance.ts, 28, 37)) diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt index e2ae62fe5e0d1..8501d6048e3af 100644 --- a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.errors.txt @@ -1,9 +1,13 @@ +tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(1,6): error TS2300: Duplicate identifier 'Position'. tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'. tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: Identifier expected. +tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(5,18): error TS2339: Property 'IgnoreRulesSpecific' does not exist on type '{ new (): Position; prototype: Position; }'. -==== tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts (2 errors) ==== +==== tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts (4 errors) ==== enum Position { + ~~~~~~~~ +!!! error TS2300: Duplicate identifier 'Position'. IgnoreRulesSpecific = 0, } var x = IgnoreRulesSpecific. @@ -12,4 +16,6 @@ tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: I !!! error TS1003: Identifier expected. var y = Position.IgnoreRulesSpecific; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'IgnoreRulesSpecific' does not exist on type '{ new (): Position; prototype: Position; }'. \ No newline at end of file diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.symbols b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.symbols index 0ca8ddaec8f7b..97ef34514bf81 100644 --- a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.symbols +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.symbols @@ -10,7 +10,5 @@ var x = IgnoreRulesSpecific. var y = Position.IgnoreRulesSpecific; >y : Symbol(y, Decl(enumConflictsWithGlobalIdentifier.ts, 4, 3)) ->Position.IgnoreRulesSpecific : Symbol(Position.IgnoreRulesSpecific, Decl(enumConflictsWithGlobalIdentifier.ts, 0, 15)) ->Position : Symbol(Position, Decl(enumConflictsWithGlobalIdentifier.ts, 0, 0)) ->IgnoreRulesSpecific : Symbol(Position.IgnoreRulesSpecific, Decl(enumConflictsWithGlobalIdentifier.ts, 0, 15)) +>Position : Symbol(Position, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.types b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.types index b593384ac3468..2c790e3f67771 100644 --- a/tests/baselines/reference/enumConflictsWithGlobalIdentifier.types +++ b/tests/baselines/reference/enumConflictsWithGlobalIdentifier.types @@ -13,8 +13,8 @@ var x = IgnoreRulesSpecific. var y = Position.IgnoreRulesSpecific; > : any ->y : Position ->Position.IgnoreRulesSpecific : Position ->Position : typeof Position ->IgnoreRulesSpecific : Position +>y : any +>Position.IgnoreRulesSpecific : any +>Position : { new (): Position; prototype: Position; } +>IgnoreRulesSpecific : any diff --git a/tests/baselines/reference/enumErrors.errors.txt b/tests/baselines/reference/enumErrors.errors.txt index af719d47ae25f..a0681ae344145 100644 --- a/tests/baselines/reference/enumErrors.errors.txt +++ b/tests/baselines/reference/enumErrors.errors.txt @@ -5,7 +5,7 @@ tests/cases/conformance/enums/enumErrors.ts(5,6): error TS2431: Enum name cannot tests/cases/conformance/enums/enumErrors.ts(9,9): error TS2322: Type 'Number' is not assignable to type 'E5'. tests/cases/conformance/enums/enumErrors.ts(26,9): error TS2322: Type 'true' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(27,9): error TS2322: Type 'Date' is not assignable to type 'E11'. -tests/cases/conformance/enums/enumErrors.ts(28,9): error TS2304: Cannot find name 'window'. +tests/cases/conformance/enums/enumErrors.ts(28,9): error TS2322: Type 'Window' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(29,9): error TS2322: Type '{}' is not assignable to type 'E11'. tests/cases/conformance/enums/enumErrors.ts(35,9): error TS2553: Computed values are not permitted in an enum with string valued members. tests/cases/conformance/enums/enumErrors.ts(36,9): error TS2553: Computed values are not permitted in an enum with string valued members. @@ -57,7 +57,7 @@ tests/cases/conformance/enums/enumErrors.ts(38,9): error TS2553: Computed values !!! error TS2322: Type 'Date' is not assignable to type 'E11'. C = window, ~~~~~~ -!!! error TS2304: Cannot find name 'window'. +!!! error TS2322: Type 'Window' is not assignable to type 'E11'. D = {} ~~ !!! error TS2322: Type '{}' is not assignable to type 'E11'. diff --git a/tests/baselines/reference/enumErrors.symbols b/tests/baselines/reference/enumErrors.symbols index e5c3bbd951937..e619debdcc906 100644 --- a/tests/baselines/reference/enumErrors.symbols +++ b/tests/baselines/reference/enumErrors.symbols @@ -59,10 +59,11 @@ enum E11 { B = new Date(), >B : Symbol(E11.B, Decl(enumErrors.ts, 25, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) C = window, >C : Symbol(E11.C, Decl(enumErrors.ts, 26, 19)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) D = {} >D : Symbol(E11.D, Decl(enumErrors.ts, 27, 15)) @@ -77,10 +78,11 @@ enum E12 { B = new Date(), >B : Symbol(E12.B, Decl(enumErrors.ts, 33, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) C = window, >C : Symbol(E12.C, Decl(enumErrors.ts, 34, 19)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) D = {}, >D : Symbol(E12.D, Decl(enumErrors.ts, 35, 15)) diff --git a/tests/baselines/reference/enumErrors.types b/tests/baselines/reference/enumErrors.types index 92fc77c24f4c7..8c95ef133ce7a 100644 --- a/tests/baselines/reference/enumErrors.types +++ b/tests/baselines/reference/enumErrors.types @@ -67,7 +67,7 @@ enum E11 { C = window, >C : E11 ->window : any +>window : Window D = {} >D : E11 @@ -89,7 +89,7 @@ enum E12 { C = window, >C : E12.B ->window : any +>window : Window D = {}, >D : E12.B diff --git a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.symbols b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.symbols index 8bae380a0f25f..f8abda0c6635e 100644 --- a/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.symbols +++ b/tests/baselines/reference/enumIsNotASubtypeOfAnythingButNumber.symbols @@ -58,7 +58,7 @@ interface I5 { [x: string]: Date; >x : Symbol(x, Decl(enumIsNotASubtypeOfAnythingButNumber.ts, 28, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: E; >foo : Symbol(I5.foo, Decl(enumIsNotASubtypeOfAnythingButNumber.ts, 28, 22)) diff --git a/tests/baselines/reference/es6ClassTest2.errors.txt b/tests/baselines/reference/es6ClassTest2.errors.txt index 0b68e1cd784e4..17d9d41ed03a5 100644 --- a/tests/baselines/reference/es6ClassTest2.errors.txt +++ b/tests/baselines/reference/es6ClassTest2.errors.txt @@ -1,9 +1,8 @@ -tests/cases/compiler/es6ClassTest2.ts(17,1): error TS2304: Cannot find name 'console'. tests/cases/compiler/es6ClassTest2.ts(30,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. tests/cases/compiler/es6ClassTest2.ts(35,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. -==== tests/cases/compiler/es6ClassTest2.ts (3 errors) ==== +==== tests/cases/compiler/es6ClassTest2.ts (2 errors) ==== class BasicMonster { constructor(public name: string, public health: number) { @@ -21,8 +20,6 @@ tests/cases/compiler/es6ClassTest2.ts(35,9): error TS1056: Accessors are only av m1.attack(m2); m1.health = 0; console.log((m5.isAlive).toString()); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. class GetSetMonster { constructor(public name: string, private _health: number) { diff --git a/tests/baselines/reference/es6ClassTest2.symbols b/tests/baselines/reference/es6ClassTest2.symbols index 7ff2bced38762..0b74e237f9352 100644 --- a/tests/baselines/reference/es6ClassTest2.symbols +++ b/tests/baselines/reference/es6ClassTest2.symbols @@ -39,6 +39,9 @@ m1.health = 0; >health : Symbol(BasicMonster.health, Decl(es6ClassTest2.ts, 1, 36)) console.log((m5.isAlive).toString()); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >m5.isAlive : Symbol(OverloadedMonster.isAlive, Decl(es6ClassTest2.ts, 58, 5)) >m5 : Symbol(m5, Decl(es6ClassTest2.ts, 63, 3)) >isAlive : Symbol(OverloadedMonster.isAlive, Decl(es6ClassTest2.ts, 58, 5)) diff --git a/tests/baselines/reference/es6ClassTest2.types b/tests/baselines/reference/es6ClassTest2.types index 2b2b5688d2a20..8f1332f46efa8 100644 --- a/tests/baselines/reference/es6ClassTest2.types +++ b/tests/baselines/reference/es6ClassTest2.types @@ -49,10 +49,10 @@ m1.health = 0; >0 : 0 console.log((m5.isAlive).toString()); ->console.log((m5.isAlive).toString()) : any ->console.log : any ->console : any ->log : any +>console.log((m5.isAlive).toString()) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >(m5.isAlive).toString() : any >(m5.isAlive).toString : any >(m5.isAlive) : any diff --git a/tests/baselines/reference/everyTypeAssignableToAny.symbols b/tests/baselines/reference/everyTypeAssignableToAny.symbols index caf8c5e47d62d..b60eac61eea6c 100644 --- a/tests/baselines/reference/everyTypeAssignableToAny.symbols +++ b/tests/baselines/reference/everyTypeAssignableToAny.symbols @@ -41,7 +41,7 @@ var d: boolean; var e: Date; >e : Symbol(e, Decl(everyTypeAssignableToAny.ts, 17, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var f: any; >f : Symbol(f, Decl(everyTypeAssignableToAny.ts, 18, 3)) @@ -166,7 +166,7 @@ function foo(x: T, y: U, z: V) { >T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 50, 13)) >U : Symbol(U, Decl(everyTypeAssignableToAny.ts, 50, 15)) >V : Symbol(V, Decl(everyTypeAssignableToAny.ts, 50, 32)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(everyTypeAssignableToAny.ts, 50, 49)) >T : Symbol(T, Decl(everyTypeAssignableToAny.ts, 50, 13)) >y : Symbol(y, Decl(everyTypeAssignableToAny.ts, 50, 54)) diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols index 8667507fb5171..1b6661bca75dd 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInitializer.symbols @@ -64,8 +64,8 @@ var aString: string = 'this is a string'; var aDate: Date = new Date(12); >aDate : Symbol(aDate, Decl(everyTypeWithAnnotationAndInitializer.ts, 26, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var anObject: Object = new Object(); >anObject : Symbol(anObject, Decl(everyTypeWithAnnotationAndInitializer.ts, 27, 3)) diff --git a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.symbols b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.symbols index 9d85b954eb132..c5a734bd035e1 100644 --- a/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.symbols +++ b/tests/baselines/reference/everyTypeWithAnnotationAndInvalidInitializer.symbols @@ -87,7 +87,7 @@ var aString: string = 9.9; var aDate: Date = 9.9; >aDate : Symbol(aDate, Decl(everyTypeWithAnnotationAndInvalidInitializer.ts, 35, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var aVoid: void = 9.9; >aVoid : Symbol(aVoid, Decl(everyTypeWithAnnotationAndInvalidInitializer.ts, 37, 3)) diff --git a/tests/baselines/reference/everyTypeWithInitializer.symbols b/tests/baselines/reference/everyTypeWithInitializer.symbols index ba269fbc53600..1dacfcf88555f 100644 --- a/tests/baselines/reference/everyTypeWithInitializer.symbols +++ b/tests/baselines/reference/everyTypeWithInitializer.symbols @@ -64,7 +64,7 @@ var aString = 'this is a string'; var aDate = new Date(12); >aDate : Symbol(aDate, Decl(everyTypeWithInitializer.ts, 26, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var anObject = new Object(); >anObject : Symbol(anObject, Decl(everyTypeWithInitializer.ts, 27, 3)) diff --git a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.errors.txt b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.errors.txt index 296493043b223..9399cfa7d1aab 100644 --- a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.errors.txt @@ -1,4 +1,3 @@ -tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts(4,23): error TS2304: Cannot find name 'window'. tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts(4,58): error TS2345: Argument of type '{ value: string; readonly: boolean; }' is not assignable to parameter of type 'PropertyDescriptor & ThisType'. Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType'. tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts(9,30): error TS2322: Type '{ y: number; }' is not assignable to type 'A & ThisType'. @@ -7,13 +6,11 @@ tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts(14,34): error TS2322: Object literal may only specify known properties, and 'y' does not exist in type 'Empty & { x: number; }'. -==== tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts (4 errors) ==== +==== tests/cases/compiler/excessPropertyCheckWithEmptyObject.ts (3 errors) ==== // Repro from #14910 // Excess property error expected here Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }); - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ value: string; readonly: boolean; }' is not assignable to parameter of type 'PropertyDescriptor & ThisType'. !!! error TS2345: Object literal may only specify known properties, and 'readonly' does not exist in type 'PropertyDescriptor & ThisType'. diff --git a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.symbols b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.symbols index 2b6b5d904285a..522fd81ffd1f7 100644 --- a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.symbols +++ b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.symbols @@ -6,6 +6,7 @@ Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }); >Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.d.ts, --, --)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) >value : Symbol(value, Decl(excessPropertyCheckWithEmptyObject.ts, 3, 39)) >readonly : Symbol(readonly, Decl(excessPropertyCheckWithEmptyObject.ts, 3, 56)) diff --git a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types index ecf15c74da581..40eb1c45c82fa 100644 --- a/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types +++ b/tests/baselines/reference/excessPropertyCheckWithEmptyObject.types @@ -7,7 +7,7 @@ Object.defineProperty(window, "prop", { value: "v1.0.0", readonly: false }); >Object.defineProperty : (o: any, p: string, attributes: PropertyDescriptor & ThisType) => any >Object : ObjectConstructor >defineProperty : (o: any, p: string, attributes: PropertyDescriptor & ThisType) => any ->window : any +>window : Window >"prop" : "prop" >{ value: "v1.0.0", readonly: false } : { value: string; readonly: boolean; } >value : string diff --git a/tests/baselines/reference/exportAssignNonIdentifier.symbols b/tests/baselines/reference/exportAssignNonIdentifier.symbols index f0826b78286d0..544af42713f95 100644 --- a/tests/baselines/reference/exportAssignNonIdentifier.symbols +++ b/tests/baselines/reference/exportAssignNonIdentifier.symbols @@ -24,7 +24,7 @@ export = void; // Error, void operator requires an argument No type information for this code. No type information for this code.=== tests/cases/conformance/externalModules/foo7.ts === export = Date || String; // Ok ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) === tests/cases/conformance/externalModules/foo8.ts === diff --git a/tests/baselines/reference/exportAssignValueAndType.symbols b/tests/baselines/reference/exportAssignValueAndType.symbols index 3d5495b4874b4..c245c75f47425 100644 --- a/tests/baselines/reference/exportAssignValueAndType.symbols +++ b/tests/baselines/reference/exportAssignValueAndType.symbols @@ -16,7 +16,7 @@ interface server { startTime: Date; >startTime : Symbol(server.startTime, Decl(exportAssignValueAndType.ts, 5, 20)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var x = 5; @@ -24,7 +24,7 @@ var x = 5; var server = new Date(); >server : Symbol(server, Decl(exportAssignValueAndType.ts, 2, 1), Decl(exportAssignValueAndType.ts, 10, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) export = server; >server : Symbol(server, Decl(exportAssignValueAndType.ts, 2, 1), Decl(exportAssignValueAndType.ts, 10, 3)) diff --git a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols index c383b8fd9e0bf..4085bff9c75e1 100644 --- a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols +++ b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.symbols @@ -12,7 +12,7 @@ interface x { >x : Symbol(x, Decl(exportAssignedTypeAsTypeAnnotation_0.ts, 0, 0)) (): Date; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: string; >foo : Symbol(x.foo, Decl(exportAssignedTypeAsTypeAnnotation_0.ts, 1, 13)) diff --git a/tests/baselines/reference/exportDefaultAsyncFunction.symbols b/tests/baselines/reference/exportDefaultAsyncFunction.symbols index 3b65dbc024584..2dce64af76d73 100644 --- a/tests/baselines/reference/exportDefaultAsyncFunction.symbols +++ b/tests/baselines/reference/exportDefaultAsyncFunction.symbols @@ -1,7 +1,7 @@ === tests/cases/compiler/exportDefaultAsyncFunction.ts === export default async function foo(): Promise {} >foo : Symbol(foo, Decl(exportDefaultAsyncFunction.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) foo(); >foo : Symbol(foo, Decl(exportDefaultAsyncFunction.ts, 0, 0)) diff --git a/tests/baselines/reference/exportDefaultAsyncFunction2.symbols b/tests/baselines/reference/exportDefaultAsyncFunction2.symbols index 9816f3120a1f4..5e120c23259f9 100644 --- a/tests/baselines/reference/exportDefaultAsyncFunction2.symbols +++ b/tests/baselines/reference/exportDefaultAsyncFunction2.symbols @@ -16,9 +16,9 @@ import { async, await } from 'asyncawait'; export default async(() => await(Promise.resolve(1))); >async : Symbol(async, Decl(a.ts, 0, 8)) >await : Symbol(await, Decl(a.ts, 0, 15)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) === tests/cases/compiler/b.ts === export default async () => { return 0; }; diff --git a/tests/baselines/reference/exportEqualErrorType.symbols b/tests/baselines/reference/exportEqualErrorType.symbols index 16f50f4fff3dd..72c9d60661bbb 100644 --- a/tests/baselines/reference/exportEqualErrorType.symbols +++ b/tests/baselines/reference/exportEqualErrorType.symbols @@ -40,7 +40,7 @@ var server: { foo: Date; >foo : Symbol(foo, Decl(exportEqualErrorType_0.ts, 9, 29)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }; export = server; diff --git a/tests/baselines/reference/exportEqualMemberMissing.symbols b/tests/baselines/reference/exportEqualMemberMissing.symbols index fe5b3d479457e..0347033840f16 100644 --- a/tests/baselines/reference/exportEqualMemberMissing.symbols +++ b/tests/baselines/reference/exportEqualMemberMissing.symbols @@ -40,7 +40,7 @@ var server: { foo: Date; >foo : Symbol(foo, Decl(exportEqualMemberMissing_0.ts, 9, 29)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }; export = server; diff --git a/tests/baselines/reference/exportEqualNamespaces.symbols b/tests/baselines/reference/exportEqualNamespaces.symbols index 0c2890b028af3..50061d55eb221 100644 --- a/tests/baselines/reference/exportEqualNamespaces.symbols +++ b/tests/baselines/reference/exportEqualNamespaces.symbols @@ -16,7 +16,7 @@ interface server { startTime: Date; >startTime : Symbol(server.startTime, Decl(exportEqualNamespaces.ts, 5, 22)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var x = 5; @@ -24,7 +24,7 @@ var x = 5; var server = new Date(); >server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) export = server; >server : Symbol(server, Decl(exportEqualNamespaces.ts, 0, 0), Decl(exportEqualNamespaces.ts, 2, 1), Decl(exportEqualNamespaces.ts, 10, 3)) diff --git a/tests/baselines/reference/expressionTypeNodeShouldError.errors.txt b/tests/baselines/reference/expressionTypeNodeShouldError.errors.txt index 86a592779caa4..625f065d8cdb5 100644 --- a/tests/baselines/reference/expressionTypeNodeShouldError.errors.txt +++ b/tests/baselines/reference/expressionTypeNodeShouldError.errors.txt @@ -2,15 +2,12 @@ tests/cases/compiler/base.d.ts(1,23): error TS1005: ',' expected. tests/cases/compiler/base.d.ts(1,34): error TS1005: '=' expected. tests/cases/compiler/boolean.ts(7,23): error TS1005: ',' expected. tests/cases/compiler/boolean.ts(7,24): error TS1134: Variable declaration expected. -tests/cases/compiler/boolean.ts(11,16): error TS2304: Cannot find name 'document'. tests/cases/compiler/boolean.ts(12,22): error TS1005: ';' expected. tests/cases/compiler/number.ts(7,26): error TS1005: ',' expected. tests/cases/compiler/number.ts(7,27): error TS1134: Variable declaration expected. -tests/cases/compiler/number.ts(11,16): error TS2304: Cannot find name 'document'. tests/cases/compiler/number.ts(12,20): error TS1005: ';' expected. tests/cases/compiler/string.ts(7,20): error TS1005: ',' expected. tests/cases/compiler/string.ts(7,21): error TS1134: Variable declaration expected. -tests/cases/compiler/string.ts(11,15): error TS2304: Cannot find name 'document'. tests/cases/compiler/string.ts(12,19): error TS1005: ';' expected. @@ -21,7 +18,7 @@ tests/cases/compiler/string.ts(12,19): error TS1005: ';' expected. ~ !!! error TS1005: '=' expected. -==== tests/cases/compiler/string.ts (4 errors) ==== +==== tests/cases/compiler/string.ts (3 errors) ==== interface String { typeof(x: T): T; } @@ -37,13 +34,11 @@ tests/cases/compiler/string.ts(12,19): error TS1005: ';' expected. } const nodes = document.getElementsByTagName("li"); - ~~~~~~~~ -!!! error TS2304: Cannot find name 'document'. type ItemType = "".typeof(nodes.item(0)); ~ !!! error TS1005: ';' expected. -==== tests/cases/compiler/number.ts (4 errors) ==== +==== tests/cases/compiler/number.ts (3 errors) ==== interface Number { typeof(x: T): T; } @@ -59,13 +54,11 @@ tests/cases/compiler/string.ts(12,19): error TS1005: ';' expected. } const nodes2 = document.getElementsByTagName("li"); - ~~~~~~~~ -!!! error TS2304: Cannot find name 'document'. type ItemType2 = 4..typeof(nodes.item(0)); ~ !!! error TS1005: ';' expected. -==== tests/cases/compiler/boolean.ts (4 errors) ==== +==== tests/cases/compiler/boolean.ts (3 errors) ==== interface Boolean { typeof(x: T): T; } @@ -81,8 +74,6 @@ tests/cases/compiler/string.ts(12,19): error TS1005: ';' expected. } const nodes3 = document.getElementsByTagName("li"); - ~~~~~~~~ -!!! error TS2304: Cannot find name 'document'. type ItemType3 = true.typeof(nodes.item(0)); ~ !!! error TS1005: ';' expected. diff --git a/tests/baselines/reference/expressionTypeNodeShouldError.symbols b/tests/baselines/reference/expressionTypeNodeShouldError.symbols index 8cf752b1cfa4b..871a4035b93c4 100644 --- a/tests/baselines/reference/expressionTypeNodeShouldError.symbols +++ b/tests/baselines/reference/expressionTypeNodeShouldError.symbols @@ -31,10 +31,15 @@ class C { const nodes = document.getElementsByTagName("li"); >nodes : Symbol(nodes, Decl(string.ts, 10, 5)) +>document.getElementsByTagName : Symbol(Document.getElementsByTagName, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>document : Symbol(document, Decl(lib.d.ts, --, --)) +>getElementsByTagName : Symbol(Document.getElementsByTagName, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type ItemType = "".typeof(nodes.item(0)); >ItemType : Symbol(ItemType, Decl(string.ts, 10, 50)) +>nodes.item : Symbol(NodeListOf.item, Decl(lib.d.ts, --, --)) >nodes : Symbol(nodes, Decl(string.ts, 10, 5)) +>item : Symbol(NodeListOf.item, Decl(lib.d.ts, --, --)) === tests/cases/compiler/number.ts === interface Number { @@ -64,10 +69,15 @@ class C2 { const nodes2 = document.getElementsByTagName("li"); >nodes2 : Symbol(nodes2, Decl(number.ts, 10, 5)) +>document.getElementsByTagName : Symbol(Document.getElementsByTagName, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>document : Symbol(document, Decl(lib.d.ts, --, --)) +>getElementsByTagName : Symbol(Document.getElementsByTagName, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type ItemType2 = 4..typeof(nodes.item(0)); >ItemType2 : Symbol(ItemType2, Decl(number.ts, 10, 51)) +>nodes.item : Symbol(NodeListOf.item, Decl(lib.d.ts, --, --)) >nodes : Symbol(nodes, Decl(string.ts, 10, 5)) +>item : Symbol(NodeListOf.item, Decl(lib.d.ts, --, --)) === tests/cases/compiler/boolean.ts === interface Boolean { @@ -97,9 +107,14 @@ class C3 { const nodes3 = document.getElementsByTagName("li"); >nodes3 : Symbol(nodes3, Decl(boolean.ts, 10, 5)) +>document.getElementsByTagName : Symbol(Document.getElementsByTagName, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>document : Symbol(document, Decl(lib.d.ts, --, --)) +>getElementsByTagName : Symbol(Document.getElementsByTagName, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type ItemType3 = true.typeof(nodes.item(0)); >ItemType3 : Symbol(ItemType3, Decl(boolean.ts, 10, 51)) +>nodes.item : Symbol(NodeListOf.item, Decl(lib.d.ts, --, --)) >nodes : Symbol(nodes, Decl(string.ts, 10, 5)) +>item : Symbol(NodeListOf.item, Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/expressionTypeNodeShouldError.types b/tests/baselines/reference/expressionTypeNodeShouldError.types index 67a44d061d19a..bcf2386ae724f 100644 --- a/tests/baselines/reference/expressionTypeNodeShouldError.types +++ b/tests/baselines/reference/expressionTypeNodeShouldError.types @@ -34,21 +34,21 @@ class C { } const nodes = document.getElementsByTagName("li"); ->nodes : any ->document.getElementsByTagName("li") : any ->document.getElementsByTagName : any ->document : any ->getElementsByTagName : any +>nodes : NodeListOf +>document.getElementsByTagName("li") : NodeListOf +>document.getElementsByTagName : { (tagname: K): ElementListTagNameMap[K]; (tagname: string): NodeListOf; } +>document : Document +>getElementsByTagName : { (tagname: K): ElementListTagNameMap[K]; (tagname: string): NodeListOf; } >"li" : "li" type ItemType = "".typeof(nodes.item(0)); >ItemType : "" >typeof(nodes.item(0)) : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" ->(nodes.item(0)) : any ->nodes.item(0) : any ->nodes.item : any ->nodes : any ->item : any +>(nodes.item(0)) : HTMLLIElement +>nodes.item(0) : HTMLLIElement +>nodes.item : (index: number) => HTMLLIElement +>nodes : NodeListOf +>item : (index: number) => HTMLLIElement >0 : 0 === tests/cases/compiler/number.ts === @@ -80,21 +80,21 @@ class C2 { } const nodes2 = document.getElementsByTagName("li"); ->nodes2 : any ->document.getElementsByTagName("li") : any ->document.getElementsByTagName : any ->document : any ->getElementsByTagName : any +>nodes2 : NodeListOf +>document.getElementsByTagName("li") : NodeListOf +>document.getElementsByTagName : { (tagname: K): ElementListTagNameMap[K]; (tagname: string): NodeListOf; } +>document : Document +>getElementsByTagName : { (tagname: K): ElementListTagNameMap[K]; (tagname: string): NodeListOf; } >"li" : "li" type ItemType2 = 4..typeof(nodes.item(0)); >ItemType2 : 4 >typeof(nodes.item(0)) : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" ->(nodes.item(0)) : any ->nodes.item(0) : any ->nodes.item : any ->nodes : any ->item : any +>(nodes.item(0)) : HTMLLIElement +>nodes.item(0) : HTMLLIElement +>nodes.item : (index: number) => HTMLLIElement +>nodes : NodeListOf +>item : (index: number) => HTMLLIElement >0 : 0 === tests/cases/compiler/boolean.ts === @@ -127,22 +127,22 @@ class C3 { } const nodes3 = document.getElementsByTagName("li"); ->nodes3 : any ->document.getElementsByTagName("li") : any ->document.getElementsByTagName : any ->document : any ->getElementsByTagName : any +>nodes3 : NodeListOf +>document.getElementsByTagName("li") : NodeListOf +>document.getElementsByTagName : { (tagname: K): ElementListTagNameMap[K]; (tagname: string): NodeListOf; } +>document : Document +>getElementsByTagName : { (tagname: K): ElementListTagNameMap[K]; (tagname: string): NodeListOf; } >"li" : "li" type ItemType3 = true.typeof(nodes.item(0)); >ItemType3 : true >true : true >typeof(nodes.item(0)) : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" ->(nodes.item(0)) : any ->nodes.item(0) : any ->nodes.item : any ->nodes : any ->item : any +>(nodes.item(0)) : HTMLLIElement +>nodes.item(0) : HTMLLIElement +>nodes.item : (index: number) => HTMLLIElement +>nodes : NodeListOf +>item : (index: number) => HTMLLIElement >0 : 0 diff --git a/tests/baselines/reference/fixSignatureCaching.errors.txt b/tests/baselines/reference/fixSignatureCaching.errors.txt index 7a5c43c966e2d..32fb1ebaf5b33 100644 --- a/tests/baselines/reference/fixSignatureCaching.errors.txt +++ b/tests/baselines/reference/fixSignatureCaching.errors.txt @@ -36,10 +36,6 @@ tests/cases/conformance/fixSignatureCaching.ts(634,36): error TS2339: Property ' tests/cases/conformance/fixSignatureCaching.ts(635,18): error TS2339: Property 'findMatch' does not exist on type '{}'. tests/cases/conformance/fixSignatureCaching.ts(635,33): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. tests/cases/conformance/fixSignatureCaching.ts(638,10): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. -tests/cases/conformance/fixSignatureCaching.ts(639,16): error TS2304: Cannot find name 'window'. -tests/cases/conformance/fixSignatureCaching.ts(639,38): error TS2304: Cannot find name 'window'. -tests/cases/conformance/fixSignatureCaching.ts(640,13): error TS2304: Cannot find name 'window'. -tests/cases/conformance/fixSignatureCaching.ts(641,13): error TS2304: Cannot find name 'window'. tests/cases/conformance/fixSignatureCaching.ts(704,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. tests/cases/conformance/fixSignatureCaching.ts(734,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. tests/cases/conformance/fixSignatureCaching.ts(783,18): error TS2339: Property 'prepareDetectionCache' does not exist on type '{}'. @@ -54,8 +50,6 @@ tests/cases/conformance/fixSignatureCaching.ts(912,36): error TS2339: Property ' tests/cases/conformance/fixSignatureCaching.ts(912,53): error TS2339: Property 'mobileDetectRules' does not exist on type '{}'. tests/cases/conformance/fixSignatureCaching.ts(941,33): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. tests/cases/conformance/fixSignatureCaching.ts(952,42): error TS2339: Property 'mobileGrade' does not exist on type '{}'. -tests/cases/conformance/fixSignatureCaching.ts(959,16): error TS2304: Cannot find name 'window'. -tests/cases/conformance/fixSignatureCaching.ts(959,42): error TS2304: Cannot find name 'window'. tests/cases/conformance/fixSignatureCaching.ts(960,22): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. tests/cases/conformance/fixSignatureCaching.ts(961,57): error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. tests/cases/conformance/fixSignatureCaching.ts(964,22): error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. @@ -67,11 +61,10 @@ tests/cases/conformance/fixSignatureCaching.ts(976,37): error TS2304: Cannot fin tests/cases/conformance/fixSignatureCaching.ts(977,23): error TS2304: Cannot find name 'define'. tests/cases/conformance/fixSignatureCaching.ts(977,48): error TS2304: Cannot find name 'define'. tests/cases/conformance/fixSignatureCaching.ts(978,16): error TS2304: Cannot find name 'define'. -tests/cases/conformance/fixSignatureCaching.ts(979,23): error TS2304: Cannot find name 'window'. -tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot find name 'window'. +tests/cases/conformance/fixSignatureCaching.ts(980,44): error TS2339: Property 'MobileDetect' does not exist on type 'Window'. -==== tests/cases/conformance/fixSignatureCaching.ts (71 errors) ==== +==== tests/cases/conformance/fixSignatureCaching.ts (64 errors) ==== // Repro from #10697 (function (define, undefined) { @@ -787,16 +780,8 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin ~~~~~~~~~~~~~~~~~~~~ !!! error TS2339: Property 'getDeviceSmallerSide' does not exist on type '{}'. return window.screen.width < window.screen.height ? - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. window.screen.width : - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. window.screen.height; - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. }; /** @@ -1143,10 +1128,6 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin // environment-dependent if (typeof window !== 'undefined' && window.screen) { - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. MobileDetect.isPhoneSized = function (maxPhoneWidth) { ~~~~~~~~~~~~ !!! error TS2339: Property 'isPhoneSized' does not exist on type '(userAgent: any, maxPhoneWidth: any) => void'. @@ -1189,11 +1170,9 @@ tests/cases/conformance/fixSignatureCaching.ts(980,37): error TS2304: Cannot fin ~~~~~~ !!! error TS2304: Cannot find name 'define'. } else if (typeof window !== 'undefined') { - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. return function (factory) { window.MobileDetect = factory(); }; - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'MobileDetect' does not exist on type 'Window'. } else { // please file a bug if you get this error! throw new Error('unknown environment'); diff --git a/tests/baselines/reference/fixSignatureCaching.symbols b/tests/baselines/reference/fixSignatureCaching.symbols index 40eb658fd6860..041cd542cc6e8 100644 --- a/tests/baselines/reference/fixSignatureCaching.symbols +++ b/tests/baselines/reference/fixSignatureCaching.symbols @@ -1117,8 +1117,31 @@ define(function () { >impl : Symbol(impl, Decl(fixSignatureCaching.ts, 6, 7)) return window.screen.width < window.screen.height ? +>window.screen.width : Symbol(Screen.width, Decl(lib.d.ts, --, --)) +>window.screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) +>screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>width : Symbol(Screen.width, Decl(lib.d.ts, --, --)) +>window.screen.height : Symbol(Screen.height, Decl(lib.d.ts, --, --)) +>window.screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) +>screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>height : Symbol(Screen.height, Decl(lib.d.ts, --, --)) + window.screen.width : +>window.screen.width : Symbol(Screen.width, Decl(lib.d.ts, --, --)) +>window.screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) +>screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>width : Symbol(Screen.width, Decl(lib.d.ts, --, --)) + window.screen.height; +>window.screen.height : Symbol(Screen.height, Decl(lib.d.ts, --, --)) +>window.screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) +>screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>height : Symbol(Screen.height, Decl(lib.d.ts, --, --)) + }; /** @@ -1533,6 +1556,11 @@ define(function () { // environment-dependent if (typeof window !== 'undefined' && window.screen) { +>window : Symbol(window, Decl(lib.d.ts, --, --)) +>window.screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) +>screen : Symbol(Window.screen, Decl(lib.d.ts, --, --)) + MobileDetect.isPhoneSized = function (maxPhoneWidth) { >MobileDetect : Symbol(MobileDetect, Decl(fixSignatureCaching.ts, 641, 6)) >maxPhoneWidth : Symbol(maxPhoneWidth, Decl(fixSignatureCaching.ts, 959, 46)) @@ -1572,8 +1600,11 @@ define(function () { } else if (typeof define === 'function' && define.amd) { return define; } else if (typeof window !== 'undefined') { +>window : Symbol(window, Decl(lib.d.ts, --, --)) + return function (factory) { window.MobileDetect = factory(); }; >factory : Symbol(factory, Decl(fixSignatureCaching.ts, 979, 25)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) >factory : Symbol(factory, Decl(fixSignatureCaching.ts, 979, 25)) } else { diff --git a/tests/baselines/reference/fixSignatureCaching.types b/tests/baselines/reference/fixSignatureCaching.types index 781912544e25d..4e9ed0d8d712c 100644 --- a/tests/baselines/reference/fixSignatureCaching.types +++ b/tests/baselines/reference/fixSignatureCaching.types @@ -2457,39 +2457,39 @@ define(function () { }; impl.getDeviceSmallerSide = function () { ->impl.getDeviceSmallerSide = function () { return window.screen.width < window.screen.height ? window.screen.width : window.screen.height; } : () => any +>impl.getDeviceSmallerSide = function () { return window.screen.width < window.screen.height ? window.screen.width : window.screen.height; } : () => number >impl.getDeviceSmallerSide : any >impl : {} >getDeviceSmallerSide : any ->function () { return window.screen.width < window.screen.height ? window.screen.width : window.screen.height; } : () => any +>function () { return window.screen.width < window.screen.height ? window.screen.width : window.screen.height; } : () => number return window.screen.width < window.screen.height ? ->window.screen.width < window.screen.height ? window.screen.width : window.screen.height : any +>window.screen.width < window.screen.height ? window.screen.width : window.screen.height : number >window.screen.width < window.screen.height : boolean ->window.screen.width : any ->window.screen : any ->window : any ->screen : any ->width : any ->window.screen.height : any ->window.screen : any ->window : any ->screen : any ->height : any +>window.screen.width : number +>window.screen : Screen +>window : Window +>screen : Screen +>width : number +>window.screen.height : number +>window.screen : Screen +>window : Window +>screen : Screen +>height : number window.screen.width : ->window.screen.width : any ->window.screen : any ->window : any ->screen : any ->width : any +>window.screen.width : number +>window.screen : Screen +>window : Window +>screen : Screen +>width : number window.screen.height; ->window.screen.height : any ->window.screen : any ->window : any ->screen : any ->height : any +>window.screen.height : number +>window.screen : Screen +>window : Window +>screen : Screen +>height : number }; @@ -3158,14 +3158,14 @@ define(function () { // environment-dependent if (typeof window !== 'undefined' && window.screen) { ->typeof window !== 'undefined' && window.screen : any +>typeof window !== 'undefined' && window.screen : Screen >typeof window !== 'undefined' : boolean >typeof window : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" ->window : any +>window : Window >'undefined' : "undefined" ->window.screen : any ->window : any ->screen : any +>window.screen : Screen +>window : Window +>screen : Screen MobileDetect.isPhoneSized = function (maxPhoneWidth) { >MobileDetect.isPhoneSized = function (maxPhoneWidth) { return maxPhoneWidth < 0 ? undefined : impl.getDeviceSmallerSide() <= maxPhoneWidth; } : (maxPhoneWidth: any) => any @@ -3259,7 +3259,7 @@ define(function () { } else if (typeof window !== 'undefined') { >typeof window !== 'undefined' : boolean >typeof window : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" ->window : any +>window : Window >'undefined' : "undefined" return function (factory) { window.MobileDetect = factory(); }; @@ -3267,7 +3267,7 @@ define(function () { >factory : any >window.MobileDetect = factory() : any >window.MobileDetect : any ->window : any +>window : Window >MobileDetect : any >factory() : any >factory : any diff --git a/tests/baselines/reference/for-inStatements.symbols b/tests/baselines/reference/for-inStatements.symbols index e0c65d3753561..04f3169fc4f76 100644 --- a/tests/baselines/reference/for-inStatements.symbols +++ b/tests/baselines/reference/for-inStatements.symbols @@ -32,7 +32,7 @@ for (var x in /[a-z]/) { } for (var x in new Date()) { } >x : Symbol(x, Decl(for-inStatements.ts, 6, 8), Decl(for-inStatements.ts, 7, 8), Decl(for-inStatements.ts, 8, 8), Decl(for-inStatements.ts, 11, 8), Decl(for-inStatements.ts, 13, 8) ... and 14 more) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var c: any, d: any, e: any; >c : Symbol(c, Decl(for-inStatements.ts, 16, 3)) diff --git a/tests/baselines/reference/for-inStatementsArray.symbols b/tests/baselines/reference/for-inStatementsArray.symbols index 0d594c193cb87..6e447f55086e1 100644 --- a/tests/baselines/reference/for-inStatementsArray.symbols +++ b/tests/baselines/reference/for-inStatementsArray.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/statements/for-inStatements/for-inStatementsArray.ts === let a: Date[]; >a : Symbol(a, Decl(for-inStatementsArray.ts, 0, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) let b: boolean[]; >b : Symbol(b, Decl(for-inStatementsArray.ts, 1, 3)) diff --git a/tests/baselines/reference/for-inStatementsArrayErrors.symbols b/tests/baselines/reference/for-inStatementsArrayErrors.symbols index 506d7739a7e61..b37ca0b37626a 100644 --- a/tests/baselines/reference/for-inStatementsArrayErrors.symbols +++ b/tests/baselines/reference/for-inStatementsArrayErrors.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts === let a: Date[]; >a : Symbol(a, Decl(for-inStatementsArrayErrors.ts, 0, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) for (let x in a) { >x : Symbol(x, Decl(for-inStatementsArrayErrors.ts, 2, 8)) diff --git a/tests/baselines/reference/for-of12.symbols b/tests/baselines/reference/for-of12.symbols index 1e3b75da731f9..cdfca2893e744 100644 --- a/tests/baselines/reference/for-of12.symbols +++ b/tests/baselines/reference/for-of12.symbols @@ -4,6 +4,6 @@ var v: string; for (v of [0, ""].values()) { } >v : Symbol(v, Decl(for-of12.ts, 0, 3)) ->[0, ""].values : Symbol(Array.values, Decl(lib.es2015.iterable.d.ts, --, --)) ->values : Symbol(Array.values, Decl(lib.es2015.iterable.d.ts, --, --)) +>[0, ""].values : Symbol(Array.values, Decl(lib.es6.d.ts, --, --)) +>values : Symbol(Array.values, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of13.symbols b/tests/baselines/reference/for-of13.symbols index d257ed5290ac8..4bdf2315c0fa8 100644 --- a/tests/baselines/reference/for-of13.symbols +++ b/tests/baselines/reference/for-of13.symbols @@ -4,6 +4,6 @@ var v: string; for (v of [""].values()) { } >v : Symbol(v, Decl(for-of13.ts, 0, 3)) ->[""].values : Symbol(Array.values, Decl(lib.es2015.iterable.d.ts, --, --)) ->values : Symbol(Array.values, Decl(lib.es2015.iterable.d.ts, --, --)) +>[""].values : Symbol(Array.values, Decl(lib.es6.d.ts, --, --)) +>values : Symbol(Array.values, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/for-of15.symbols b/tests/baselines/reference/for-of15.symbols index b2ca9c4f09141..4436a7599431a 100644 --- a/tests/baselines/reference/for-of15.symbols +++ b/tests/baselines/reference/for-of15.symbols @@ -8,9 +8,9 @@ class StringIterator { return ""; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of15.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of16.symbols b/tests/baselines/reference/for-of16.symbols index 9d3d1dee7207c..fb6ff42d74816 100644 --- a/tests/baselines/reference/for-of16.symbols +++ b/tests/baselines/reference/for-of16.symbols @@ -3,9 +3,9 @@ class StringIterator { >StringIterator : Symbol(StringIterator, Decl(for-of16.ts, 0, 0)) [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of16.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of17.symbols b/tests/baselines/reference/for-of17.symbols index 506c9535ed7ec..15162ed375a96 100644 --- a/tests/baselines/reference/for-of17.symbols +++ b/tests/baselines/reference/for-of17.symbols @@ -15,9 +15,9 @@ class NumberIterator { }; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(NumberIterator, Decl(for-of17.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of18.symbols b/tests/baselines/reference/for-of18.symbols index 8f552c2757c8f..9e8129b8555de 100644 --- a/tests/baselines/reference/for-of18.symbols +++ b/tests/baselines/reference/for-of18.symbols @@ -15,9 +15,9 @@ class StringIterator { }; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of18.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of19.symbols b/tests/baselines/reference/for-of19.symbols index f36dd74f9b992..475e9bdef4dec 100644 --- a/tests/baselines/reference/for-of19.symbols +++ b/tests/baselines/reference/for-of19.symbols @@ -19,9 +19,9 @@ class FooIterator { }; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(for-of19.ts, 0, 13)) diff --git a/tests/baselines/reference/for-of20.symbols b/tests/baselines/reference/for-of20.symbols index 5fff9fd7871c1..135950b990671 100644 --- a/tests/baselines/reference/for-of20.symbols +++ b/tests/baselines/reference/for-of20.symbols @@ -19,9 +19,9 @@ class FooIterator { }; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(for-of20.ts, 0, 13)) diff --git a/tests/baselines/reference/for-of21.symbols b/tests/baselines/reference/for-of21.symbols index 0068c9ef4a8d1..e0580b2309d23 100644 --- a/tests/baselines/reference/for-of21.symbols +++ b/tests/baselines/reference/for-of21.symbols @@ -19,9 +19,9 @@ class FooIterator { }; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(for-of21.ts, 0, 13)) diff --git a/tests/baselines/reference/for-of22.symbols b/tests/baselines/reference/for-of22.symbols index 929cae4ed77a0..ab5d5dc297945 100644 --- a/tests/baselines/reference/for-of22.symbols +++ b/tests/baselines/reference/for-of22.symbols @@ -19,9 +19,9 @@ class FooIterator { }; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(for-of22.ts, 0, 13)) diff --git a/tests/baselines/reference/for-of23.symbols b/tests/baselines/reference/for-of23.symbols index 7a57e38baf76e..1f3c2b7c16bee 100644 --- a/tests/baselines/reference/for-of23.symbols +++ b/tests/baselines/reference/for-of23.symbols @@ -19,9 +19,9 @@ class FooIterator { }; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(for-of23.ts, 0, 13)) diff --git a/tests/baselines/reference/for-of25.symbols b/tests/baselines/reference/for-of25.symbols index e9304e517bdfa..3f2a0d8173d55 100644 --- a/tests/baselines/reference/for-of25.symbols +++ b/tests/baselines/reference/for-of25.symbols @@ -3,9 +3,9 @@ class StringIterator { >StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 0, 0)) [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return x; >x : Symbol(x, Decl(for-of25.ts, 6, 3)) diff --git a/tests/baselines/reference/for-of26.symbols b/tests/baselines/reference/for-of26.symbols index 2047389825320..ae139558650f2 100644 --- a/tests/baselines/reference/for-of26.symbols +++ b/tests/baselines/reference/for-of26.symbols @@ -9,9 +9,9 @@ class StringIterator { >x : Symbol(x, Decl(for-of26.ts, 9, 3)) } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of26.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of27.symbols b/tests/baselines/reference/for-of27.symbols index 4799a13835140..994e2a74462af 100644 --- a/tests/baselines/reference/for-of27.symbols +++ b/tests/baselines/reference/for-of27.symbols @@ -3,9 +3,9 @@ class StringIterator { >StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 0)) [Symbol.iterator]: any; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) } for (var v of new StringIterator) { } diff --git a/tests/baselines/reference/for-of28.symbols b/tests/baselines/reference/for-of28.symbols index ad5ea53a80e32..c0f679b22e838 100644 --- a/tests/baselines/reference/for-of28.symbols +++ b/tests/baselines/reference/for-of28.symbols @@ -6,9 +6,9 @@ class StringIterator { >next : Symbol(StringIterator.next, Decl(for-of28.ts, 0, 22)) [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of28.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of29.symbols b/tests/baselines/reference/for-of29.symbols index 8327d0ac85531..fb15a02cc14d5 100644 --- a/tests/baselines/reference/for-of29.symbols +++ b/tests/baselines/reference/for-of29.symbols @@ -3,10 +3,10 @@ var iterableWithOptionalIterator: { >iterableWithOptionalIterator : Symbol(iterableWithOptionalIterator, Decl(for-of29.ts, 0, 3)) [Symbol.iterator]?(): Iterator ->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, --, --)) ->Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Iterator : Symbol(Iterator, Decl(lib.es6.d.ts, --, --)) }; diff --git a/tests/baselines/reference/for-of30.symbols b/tests/baselines/reference/for-of30.symbols index 8762025111071..dbe9c17eb7192 100644 --- a/tests/baselines/reference/for-of30.symbols +++ b/tests/baselines/reference/for-of30.symbols @@ -18,9 +18,9 @@ class StringIterator { >return : Symbol(StringIterator.return, Decl(for-of30.ts, 6, 5)) [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of30.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of31.symbols b/tests/baselines/reference/for-of31.symbols index b5f999db49c91..15900209a8d24 100644 --- a/tests/baselines/reference/for-of31.symbols +++ b/tests/baselines/reference/for-of31.symbols @@ -13,9 +13,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of31.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of33.symbols b/tests/baselines/reference/for-of33.symbols index e77d3b31c76bf..ecb4f6c48ea69 100644 --- a/tests/baselines/reference/for-of33.symbols +++ b/tests/baselines/reference/for-of33.symbols @@ -3,9 +3,9 @@ class StringIterator { >StringIterator : Symbol(StringIterator, Decl(for-of33.ts, 0, 0)) [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return v; >v : Symbol(v, Decl(for-of33.ts, 6, 8)) diff --git a/tests/baselines/reference/for-of34.symbols b/tests/baselines/reference/for-of34.symbols index 864e250ad492b..0587405edcb55 100644 --- a/tests/baselines/reference/for-of34.symbols +++ b/tests/baselines/reference/for-of34.symbols @@ -10,9 +10,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of34.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of35.symbols b/tests/baselines/reference/for-of35.symbols index b1f48ba3afb98..1690a53ce7ba1 100644 --- a/tests/baselines/reference/for-of35.symbols +++ b/tests/baselines/reference/for-of35.symbols @@ -16,9 +16,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(for-of35.ts, 0, 0)) diff --git a/tests/baselines/reference/for-of37.symbols b/tests/baselines/reference/for-of37.symbols index c9c5c627b8a89..e89cd2107b749 100644 --- a/tests/baselines/reference/for-of37.symbols +++ b/tests/baselines/reference/for-of37.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of37.ts === var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of37.ts, 0, 3)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) for (var v of map) { >v : Symbol(v, Decl(for-of37.ts, 1, 8)) diff --git a/tests/baselines/reference/for-of38.symbols b/tests/baselines/reference/for-of38.symbols index d1df1afea3b1d..6b2f3d5dfb2a0 100644 --- a/tests/baselines/reference/for-of38.symbols +++ b/tests/baselines/reference/for-of38.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of38.ts === var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of38.ts, 0, 3)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) for (var [k, v] of map) { >k : Symbol(k, Decl(for-of38.ts, 1, 10)) diff --git a/tests/baselines/reference/for-of40.symbols b/tests/baselines/reference/for-of40.symbols index 37fff14455955..1fd88ab268dbe 100644 --- a/tests/baselines/reference/for-of40.symbols +++ b/tests/baselines/reference/for-of40.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of40.ts === var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of40.ts, 0, 3)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) for (var [k = "", v = false] of map) { >k : Symbol(k, Decl(for-of40.ts, 1, 10)) diff --git a/tests/baselines/reference/for-of44.symbols b/tests/baselines/reference/for-of44.symbols index fb951a6ef8aa1..3c1db7bf525a2 100644 --- a/tests/baselines/reference/for-of44.symbols +++ b/tests/baselines/reference/for-of44.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of44.ts === var array: [number, string | boolean | symbol][] = [[0, ""], [0, true], [1, Symbol()]] >array : Symbol(array, Decl(for-of44.ts, 0, 3)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) for (var [num, strBoolSym] of array) { >num : Symbol(num, Decl(for-of44.ts, 1, 10)) diff --git a/tests/baselines/reference/for-of45.symbols b/tests/baselines/reference/for-of45.symbols index 3a0968069c860..02f0244d76904 100644 --- a/tests/baselines/reference/for-of45.symbols +++ b/tests/baselines/reference/for-of45.symbols @@ -5,7 +5,7 @@ var k: string, v: boolean; var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of45.ts, 1, 3)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) for ([k = "", v = false] of map) { >k : Symbol(k, Decl(for-of45.ts, 0, 3)) diff --git a/tests/baselines/reference/for-of46.symbols b/tests/baselines/reference/for-of46.symbols index c8ff2106f222e..07c6283999912 100644 --- a/tests/baselines/reference/for-of46.symbols +++ b/tests/baselines/reference/for-of46.symbols @@ -5,7 +5,7 @@ var k: string, v: boolean; var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of46.ts, 1, 3)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) for ([k = false, v = ""] of map) { >k : Symbol(k, Decl(for-of46.ts, 0, 3)) diff --git a/tests/baselines/reference/for-of49.symbols b/tests/baselines/reference/for-of49.symbols index 8d0c4b64255b4..043c81f6d8822 100644 --- a/tests/baselines/reference/for-of49.symbols +++ b/tests/baselines/reference/for-of49.symbols @@ -5,7 +5,7 @@ var k: string, v: boolean; var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of49.ts, 1, 3)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) for ([k, ...[v]] of map) { >k : Symbol(k, Decl(for-of49.ts, 0, 3)) diff --git a/tests/baselines/reference/for-of50.symbols b/tests/baselines/reference/for-of50.symbols index ad9b06d48a9ba..278ee0f852a87 100644 --- a/tests/baselines/reference/for-of50.symbols +++ b/tests/baselines/reference/for-of50.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of50.ts === var map = new Map([["", true]]); >map : Symbol(map, Decl(for-of50.ts, 0, 3)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) for (const [k, v] of map) { >k : Symbol(k, Decl(for-of50.ts, 1, 12)) diff --git a/tests/baselines/reference/for-of57.symbols b/tests/baselines/reference/for-of57.symbols index 7428ab54b839b..5c5d18ec95607 100644 --- a/tests/baselines/reference/for-of57.symbols +++ b/tests/baselines/reference/for-of57.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/for-ofStatements/for-of57.ts === var iter: Iterable; >iter : Symbol(iter, Decl(for-of57.ts, 0, 3)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) for (let num of iter) { } >num : Symbol(num, Decl(for-of57.ts, 1, 8)) diff --git a/tests/baselines/reference/forStatements.symbols b/tests/baselines/reference/forStatements.symbols index e775d615f3654..be1ca79fbbc97 100644 --- a/tests/baselines/reference/forStatements.symbols +++ b/tests/baselines/reference/forStatements.symbols @@ -64,8 +64,8 @@ for(var aString: string = 'this is a string';;){} for(var aDate: Date = new Date(12);;){} >aDate : Symbol(aDate, Decl(forStatements.ts, 26, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) for(var anObject: Object = new Object();;){} >anObject : Symbol(anObject, Decl(forStatements.ts, 27, 7)) diff --git a/tests/baselines/reference/functionCalls.errors.txt b/tests/baselines/reference/functionCalls.errors.txt index 8e84aa81e0e78..85e7587677901 100644 --- a/tests/baselines/reference/functionCalls.errors.txt +++ b/tests/baselines/reference/functionCalls.errors.txt @@ -1,7 +1,6 @@ tests/cases/conformance/expressions/functionCalls/functionCalls.ts(8,1): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/expressions/functionCalls/functionCalls.ts(9,1): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/expressions/functionCalls/functionCalls.ts(10,1): error TS2347: Untyped function calls may not accept type arguments. -tests/cases/conformance/expressions/functionCalls/functionCalls.ts(10,8): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/functionCalls.ts(25,1): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/expressions/functionCalls/functionCalls.ts(26,1): error TS2347: Untyped function calls may not accept type arguments. tests/cases/conformance/expressions/functionCalls/functionCalls.ts(27,1): error TS2347: Untyped function calls may not accept type arguments. @@ -10,7 +9,7 @@ tests/cases/conformance/expressions/functionCalls/functionCalls.ts(33,1): error tests/cases/conformance/expressions/functionCalls/functionCalls.ts(34,1): error TS2347: Untyped function calls may not accept type arguments. -==== tests/cases/conformance/expressions/functionCalls/functionCalls.ts (10 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/functionCalls.ts (9 errors) ==== // Invoke function call on value of type 'any' with no type arguments var anyVar: any; anyVar(0); @@ -27,8 +26,6 @@ tests/cases/conformance/expressions/functionCalls/functionCalls.ts(34,1): error anyVar(undefined); ~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2347: Untyped function calls may not accept type arguments. - ~~~~~~ -!!! error TS2304: Cannot find name 'Window'. // Invoke function call on value of a subtype of Function with no call signatures with no type arguments diff --git a/tests/baselines/reference/functionCalls.symbols b/tests/baselines/reference/functionCalls.symbols index 34fbb1f6c3982..1ecb8534cd207 100644 --- a/tests/baselines/reference/functionCalls.symbols +++ b/tests/baselines/reference/functionCalls.symbols @@ -19,6 +19,7 @@ anyVar(); anyVar(undefined); >anyVar : Symbol(anyVar, Decl(functionCalls.ts, 1, 3)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) diff --git a/tests/baselines/reference/functionCalls.types b/tests/baselines/reference/functionCalls.types index ac7071889469b..3b50d75aeb919 100644 --- a/tests/baselines/reference/functionCalls.types +++ b/tests/baselines/reference/functionCalls.types @@ -27,7 +27,7 @@ anyVar(); anyVar(undefined); >anyVar(undefined) : any >anyVar : any ->Window : No type information available! +>Window : Window >undefined : undefined diff --git a/tests/baselines/reference/functionConstraintSatisfaction.symbols b/tests/baselines/reference/functionConstraintSatisfaction.symbols index 6c7ca5f7713f2..71f5b47707a01 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction.symbols +++ b/tests/baselines/reference/functionConstraintSatisfaction.symbols @@ -154,7 +154,7 @@ var r11 = foo((x: U) => x); >r11 : Symbol(r11, Decl(functionConstraintSatisfaction.ts, 42, 3)) >foo : Symbol(foo, Decl(functionConstraintSatisfaction.ts, 0, 0)) >U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 42, 15)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 42, 31)) >U : Symbol(U, Decl(functionConstraintSatisfaction.ts, 42, 15)) >x : Symbol(x, Decl(functionConstraintSatisfaction.ts, 42, 31)) diff --git a/tests/baselines/reference/functionOverloadErrors.errors.txt b/tests/baselines/reference/functionOverloadErrors.errors.txt index 1ec0344ac6232..ddcaf4786021c 100644 --- a/tests/baselines/reference/functionOverloadErrors.errors.txt +++ b/tests/baselines/reference/functionOverloadErrors.errors.txt @@ -1,7 +1,4 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(2,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -tests/cases/conformance/functions/functionOverloadErrors.ts(44,25): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/functions/functionOverloadErrors.ts(50,25): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/functions/functionOverloadErrors.ts(51,32): error TS2304: Cannot find name 'window'. tests/cases/conformance/functions/functionOverloadErrors.ts(65,13): error TS2385: Overload signatures must all be public, private or protected. tests/cases/conformance/functions/functionOverloadErrors.ts(68,13): error TS2385: Overload signatures must all be public, private or protected. tests/cases/conformance/functions/functionOverloadErrors.ts(75,21): error TS2383: Overload signatures must all be exported or non-exported. @@ -14,7 +11,7 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(103,10): error TS239 tests/cases/conformance/functions/functionOverloadErrors.ts(116,19): error TS2371: A parameter initializer is only allowed in a function or constructor implementation. -==== tests/cases/conformance/functions/functionOverloadErrors.ts (14 errors) ==== +==== tests/cases/conformance/functions/functionOverloadErrors.ts (11 errors) ==== //Function overload signature with initializer function fn1(x = 3); ~~~~~ @@ -61,19 +58,13 @@ tests/cases/conformance/functions/functionOverloadErrors.ts(116,19): error TS237 //Function overloads that differ only by type parameter constraints function fn10(); - ~~~~~~ -!!! error TS2304: Cannot find name 'Window'. function fn10(); function fn10() { } // (actually OK) //Function overloads that differ only by type parameter constraints where constraints are structually identical function fn11(); - ~~~~~~ -!!! error TS2304: Cannot find name 'Window'. function fn11(); - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. function fn11() { } //Function overloads that differ only by type parameter constraints where constraints include infinitely recursive type reference diff --git a/tests/baselines/reference/functionOverloadErrors.symbols b/tests/baselines/reference/functionOverloadErrors.symbols index 8bfd05eb1b214..fe548f740c102 100644 --- a/tests/baselines/reference/functionOverloadErrors.symbols +++ b/tests/baselines/reference/functionOverloadErrors.symbols @@ -106,11 +106,12 @@ function fn9() { } function fn10(); >fn10 : Symbol(fn10, Decl(functionOverloadErrors.ts, 40, 18), Decl(functionOverloadErrors.ts, 43, 34), Decl(functionOverloadErrors.ts, 44, 32)) >T : Symbol(T, Decl(functionOverloadErrors.ts, 43, 14)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function fn10(); >fn10 : Symbol(fn10, Decl(functionOverloadErrors.ts, 40, 18), Decl(functionOverloadErrors.ts, 43, 34), Decl(functionOverloadErrors.ts, 44, 32)) >S : Symbol(S, Decl(functionOverloadErrors.ts, 44, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function fn10() { } >fn10 : Symbol(fn10, Decl(functionOverloadErrors.ts, 40, 18), Decl(functionOverloadErrors.ts, 43, 34), Decl(functionOverloadErrors.ts, 44, 32)) @@ -121,10 +122,12 @@ function fn10() { } function fn11(); >fn11 : Symbol(fn11, Decl(functionOverloadErrors.ts, 45, 19), Decl(functionOverloadErrors.ts, 49, 34), Decl(functionOverloadErrors.ts, 50, 41)) >T : Symbol(T, Decl(functionOverloadErrors.ts, 49, 14)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function fn11(); >fn11 : Symbol(fn11, Decl(functionOverloadErrors.ts, 45, 19), Decl(functionOverloadErrors.ts, 49, 34), Decl(functionOverloadErrors.ts, 50, 41)) >S : Symbol(S, Decl(functionOverloadErrors.ts, 50, 14)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) function fn11() { } >fn11 : Symbol(fn11, Decl(functionOverloadErrors.ts, 45, 19), Decl(functionOverloadErrors.ts, 49, 34), Decl(functionOverloadErrors.ts, 50, 41)) diff --git a/tests/baselines/reference/functionOverloadErrors.types b/tests/baselines/reference/functionOverloadErrors.types index 3f056f36856d3..958a498e65159 100644 --- a/tests/baselines/reference/functionOverloadErrors.types +++ b/tests/baselines/reference/functionOverloadErrors.types @@ -106,33 +106,33 @@ function fn9() { } //Function overloads that differ only by type parameter constraints function fn10(); ->fn10 : { (): any; (): any; } +>fn10 : { (): any; (): any; } >T : T ->Window : No type information available! +>Window : Window function fn10(); ->fn10 : { (): any; (): any; } +>fn10 : { (): any; (): any; } >S : S >Date : Date function fn10() { } ->fn10 : { (): any; (): any; } +>fn10 : { (): any; (): any; } // (actually OK) //Function overloads that differ only by type parameter constraints where constraints are structually identical function fn11(); ->fn11 : { (): any; (): any; } +>fn11 : { (): any; (): any; } >T : T ->Window : No type information available! +>Window : Window function fn11(); ->fn11 : { (): any; (): any; } +>fn11 : { (): any; (): any; } >S : S ->window : any +>window : Window function fn11() { } ->fn11 : { (): any; (): any; } +>fn11 : { (): any; (): any; } //Function overloads that differ only by type parameter constraints where constraints include infinitely recursive type reference interface List { diff --git a/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols b/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols index 750da358d674e..dd5ac2977581d 100644 --- a/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols +++ b/tests/baselines/reference/functionOverloadsOnGenericArity2.symbols @@ -16,5 +16,5 @@ interface I { >U : Symbol(U, Decl(functionOverloadsOnGenericArity2.ts, 3, 9)) >T : Symbol(T, Decl(functionOverloadsOnGenericArity2.ts, 3, 11)) >p : Symbol(p, Decl(functionOverloadsOnGenericArity2.ts, 3, 15)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt index 2fa3cafcb1ac9..def0ff8811e71 100644 --- a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt +++ b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.errors.txt @@ -1,9 +1,8 @@ tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts(9,1): error TS2322: Type '() => S[]' is not assignable to type '(x: T) => T'. Type '{}[]' is not assignable to type 'T'. -tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts(12,1): error TS2304: Cannot find name 'console'. -==== tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts (2 errors) ==== +==== tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts (1 errors) ==== var f : { (x:T): T; } @@ -19,6 +18,4 @@ tests/cases/compiler/functionTypeArgumentAssignmentCompat.ts(12,1): error TS2304 var s = f("str").toUpperCase(); console.log(s); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.symbols b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.symbols index 1ec90fb497050..afba235425d05 100644 --- a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.symbols +++ b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.symbols @@ -29,5 +29,8 @@ var s = f("str").toUpperCase(); >toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, --, --)) console.log(s); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(functionTypeArgumentAssignmentCompat.ts, 9, 3)) diff --git a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.types b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.types index 2d072d6ec2434..6b7f73c7eb670 100644 --- a/tests/baselines/reference/functionTypeArgumentAssignmentCompat.types +++ b/tests/baselines/reference/functionTypeArgumentAssignmentCompat.types @@ -35,9 +35,9 @@ var s = f("str").toUpperCase(); >toUpperCase : () => string console.log(s); ->console.log(s) : any ->console.log : any ->console : any ->log : any +>console.log(s) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >s : string diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.errors.txt b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.errors.txt deleted file mode 100644 index 4e60ceda6b5d3..0000000000000 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -tests/cases/compiler/functionWithDefaultParameterWithNoStatements9.ts(1,18): error TS2304: Cannot find name 'console'. -tests/cases/compiler/functionWithDefaultParameterWithNoStatements9.ts(3,18): error TS2304: Cannot find name 'console'. - - -==== tests/cases/compiler/functionWithDefaultParameterWithNoStatements9.ts (2 errors) ==== - function foo(a = console.log) { } - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - - function bar(a = console.log) { - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - } \ No newline at end of file diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.symbols b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.symbols index 879858d67ad8c..a6e0b70ba60f9 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.symbols +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.symbols @@ -2,8 +2,14 @@ function foo(a = console.log) { } >foo : Symbol(foo, Decl(functionWithDefaultParameterWithNoStatements9.ts, 0, 0)) >a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements9.ts, 0, 13)) +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) function bar(a = console.log) { >bar : Symbol(bar, Decl(functionWithDefaultParameterWithNoStatements9.ts, 0, 33)) >a : Symbol(a, Decl(functionWithDefaultParameterWithNoStatements9.ts, 2, 13)) +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.types b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.types index 40dd92293152b..4a22cafc486af 100644 --- a/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.types +++ b/tests/baselines/reference/functionWithDefaultParameterWithNoStatements9.types @@ -1,15 +1,15 @@ === tests/cases/compiler/functionWithDefaultParameterWithNoStatements9.ts === function foo(a = console.log) { } ->foo : (a?: any) => void ->a : any ->console.log : any ->console : any ->log : any +>foo : (a?: (message?: any, ...optionalParams: any[]) => void) => void +>a : (message?: any, ...optionalParams: any[]) => void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void function bar(a = console.log) { ->bar : (a?: any) => void ->a : any ->console.log : any ->console : any ->log : any +>bar : (a?: (message?: any, ...optionalParams: any[]) => void) => void +>a : (message?: any, ...optionalParams: any[]) => void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void } diff --git a/tests/baselines/reference/generatorES6_6.symbols b/tests/baselines/reference/generatorES6_6.symbols index e277757e98dcd..4b3fc684edcfb 100644 --- a/tests/baselines/reference/generatorES6_6.symbols +++ b/tests/baselines/reference/generatorES6_6.symbols @@ -3,9 +3,9 @@ class C { >C : Symbol(C, Decl(generatorES6_6.ts, 0, 0)) *[Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) let a = yield 1; >a : Symbol(a, Decl(generatorES6_6.ts, 2, 7)) diff --git a/tests/baselines/reference/generatorOverloads1.symbols b/tests/baselines/reference/generatorOverloads1.symbols index 38215c2a3431a..7497f051332a0 100644 --- a/tests/baselines/reference/generatorOverloads1.symbols +++ b/tests/baselines/reference/generatorOverloads1.symbols @@ -5,15 +5,15 @@ module M { function* f(s: string): Iterable; >f : Symbol(f, Decl(generatorOverloads1.ts, 0, 10), Decl(generatorOverloads1.ts, 1, 42), Decl(generatorOverloads1.ts, 2, 42)) >s : Symbol(s, Decl(generatorOverloads1.ts, 1, 16)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) function* f(s: number): Iterable; >f : Symbol(f, Decl(generatorOverloads1.ts, 0, 10), Decl(generatorOverloads1.ts, 1, 42), Decl(generatorOverloads1.ts, 2, 42)) >s : Symbol(s, Decl(generatorOverloads1.ts, 2, 16)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) function* f(s: any): Iterable { } >f : Symbol(f, Decl(generatorOverloads1.ts, 0, 10), Decl(generatorOverloads1.ts, 1, 42), Decl(generatorOverloads1.ts, 2, 42)) >s : Symbol(s, Decl(generatorOverloads1.ts, 3, 16)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/generatorOverloads2.symbols b/tests/baselines/reference/generatorOverloads2.symbols index 9a80182cf0ac0..184e4832e160a 100644 --- a/tests/baselines/reference/generatorOverloads2.symbols +++ b/tests/baselines/reference/generatorOverloads2.symbols @@ -5,15 +5,15 @@ declare module M { function* f(s: string): Iterable; >f : Symbol(f, Decl(generatorOverloads2.ts, 0, 18), Decl(generatorOverloads2.ts, 1, 42), Decl(generatorOverloads2.ts, 2, 42)) >s : Symbol(s, Decl(generatorOverloads2.ts, 1, 16)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) function* f(s: number): Iterable; >f : Symbol(f, Decl(generatorOverloads2.ts, 0, 18), Decl(generatorOverloads2.ts, 1, 42), Decl(generatorOverloads2.ts, 2, 42)) >s : Symbol(s, Decl(generatorOverloads2.ts, 2, 16)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) function* f(s: any): Iterable; >f : Symbol(f, Decl(generatorOverloads2.ts, 0, 18), Decl(generatorOverloads2.ts, 1, 42), Decl(generatorOverloads2.ts, 2, 42)) >s : Symbol(s, Decl(generatorOverloads2.ts, 3, 16)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/generatorOverloads3.symbols b/tests/baselines/reference/generatorOverloads3.symbols index 2fdf8c5658031..ca2f704e9e993 100644 --- a/tests/baselines/reference/generatorOverloads3.symbols +++ b/tests/baselines/reference/generatorOverloads3.symbols @@ -5,15 +5,15 @@ class C { *f(s: string): Iterable; >f : Symbol(C.f, Decl(generatorOverloads3.ts, 0, 9), Decl(generatorOverloads3.ts, 1, 33), Decl(generatorOverloads3.ts, 2, 33)) >s : Symbol(s, Decl(generatorOverloads3.ts, 1, 7)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) *f(s: number): Iterable; >f : Symbol(C.f, Decl(generatorOverloads3.ts, 0, 9), Decl(generatorOverloads3.ts, 1, 33), Decl(generatorOverloads3.ts, 2, 33)) >s : Symbol(s, Decl(generatorOverloads3.ts, 2, 7)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) *f(s: any): Iterable { } >f : Symbol(C.f, Decl(generatorOverloads3.ts, 0, 9), Decl(generatorOverloads3.ts, 1, 33), Decl(generatorOverloads3.ts, 2, 33)) >s : Symbol(s, Decl(generatorOverloads3.ts, 3, 7)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/generatorOverloads4.symbols b/tests/baselines/reference/generatorOverloads4.symbols index f7ab5bc1f9508..7fa2608d65a58 100644 --- a/tests/baselines/reference/generatorOverloads4.symbols +++ b/tests/baselines/reference/generatorOverloads4.symbols @@ -5,15 +5,15 @@ class C { f(s: string): Iterable; >f : Symbol(C.f, Decl(generatorOverloads4.ts, 0, 9), Decl(generatorOverloads4.ts, 1, 32), Decl(generatorOverloads4.ts, 2, 32)) >s : Symbol(s, Decl(generatorOverloads4.ts, 1, 6)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) f(s: number): Iterable; >f : Symbol(C.f, Decl(generatorOverloads4.ts, 0, 9), Decl(generatorOverloads4.ts, 1, 32), Decl(generatorOverloads4.ts, 2, 32)) >s : Symbol(s, Decl(generatorOverloads4.ts, 2, 6)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) *f(s: any): Iterable { } >f : Symbol(C.f, Decl(generatorOverloads4.ts, 0, 9), Decl(generatorOverloads4.ts, 1, 32), Decl(generatorOverloads4.ts, 2, 32)) >s : Symbol(s, Decl(generatorOverloads4.ts, 3, 7)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/generatorOverloads5.symbols b/tests/baselines/reference/generatorOverloads5.symbols index feb27cabed048..e99fd377d6da1 100644 --- a/tests/baselines/reference/generatorOverloads5.symbols +++ b/tests/baselines/reference/generatorOverloads5.symbols @@ -5,15 +5,15 @@ module M { function f(s: string): Iterable; >f : Symbol(f, Decl(generatorOverloads5.ts, 0, 10), Decl(generatorOverloads5.ts, 1, 41), Decl(generatorOverloads5.ts, 2, 41)) >s : Symbol(s, Decl(generatorOverloads5.ts, 1, 15)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) function f(s: number): Iterable; >f : Symbol(f, Decl(generatorOverloads5.ts, 0, 10), Decl(generatorOverloads5.ts, 1, 41), Decl(generatorOverloads5.ts, 2, 41)) >s : Symbol(s, Decl(generatorOverloads5.ts, 2, 15)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) function* f(s: any): Iterable { } >f : Symbol(f, Decl(generatorOverloads5.ts, 0, 10), Decl(generatorOverloads5.ts, 1, 41), Decl(generatorOverloads5.ts, 2, 41)) >s : Symbol(s, Decl(generatorOverloads5.ts, 3, 16)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/generatorTypeCheck1.symbols b/tests/baselines/reference/generatorTypeCheck1.symbols index dbb6db06833aa..efcdb8215ae7a 100644 --- a/tests/baselines/reference/generatorTypeCheck1.symbols +++ b/tests/baselines/reference/generatorTypeCheck1.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck1.ts === function* g1(): Iterator { } >g1 : Symbol(g1, Decl(generatorTypeCheck1.ts, 0, 0)) ->Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterator : Symbol(Iterator, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/generatorTypeCheck10.symbols b/tests/baselines/reference/generatorTypeCheck10.symbols index 3d6f8cf889a33..50f56a8c82e24 100644 --- a/tests/baselines/reference/generatorTypeCheck10.symbols +++ b/tests/baselines/reference/generatorTypeCheck10.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck10.ts === function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck10.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) return; } diff --git a/tests/baselines/reference/generatorTypeCheck11.symbols b/tests/baselines/reference/generatorTypeCheck11.symbols index aea1ffd781c7d..923a9b5c880dc 100644 --- a/tests/baselines/reference/generatorTypeCheck11.symbols +++ b/tests/baselines/reference/generatorTypeCheck11.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck11.ts === function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck11.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) return 0; } diff --git a/tests/baselines/reference/generatorTypeCheck12.symbols b/tests/baselines/reference/generatorTypeCheck12.symbols index 2dc7d5d42ab2a..b9145c00fdd6b 100644 --- a/tests/baselines/reference/generatorTypeCheck12.symbols +++ b/tests/baselines/reference/generatorTypeCheck12.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck12.ts === function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck12.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) return ""; } diff --git a/tests/baselines/reference/generatorTypeCheck13.symbols b/tests/baselines/reference/generatorTypeCheck13.symbols index 494356185c8a1..0ca8616dfc320 100644 --- a/tests/baselines/reference/generatorTypeCheck13.symbols +++ b/tests/baselines/reference/generatorTypeCheck13.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck13.ts === function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck13.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) yield 0; return ""; diff --git a/tests/baselines/reference/generatorTypeCheck17.symbols b/tests/baselines/reference/generatorTypeCheck17.symbols index 6e4941dd7cf86..099f0b415c8b0 100644 --- a/tests/baselines/reference/generatorTypeCheck17.symbols +++ b/tests/baselines/reference/generatorTypeCheck17.symbols @@ -10,7 +10,7 @@ class Bar extends Foo { y: string } function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck17.ts, 1, 35)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >Foo : Symbol(Foo, Decl(generatorTypeCheck17.ts, 0, 0)) yield; diff --git a/tests/baselines/reference/generatorTypeCheck18.symbols b/tests/baselines/reference/generatorTypeCheck18.symbols index 103f3c4e48a8c..87157a10fe585 100644 --- a/tests/baselines/reference/generatorTypeCheck18.symbols +++ b/tests/baselines/reference/generatorTypeCheck18.symbols @@ -9,7 +9,7 @@ class Baz { z: number } function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck18.ts, 1, 23)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >Foo : Symbol(Foo, Decl(generatorTypeCheck18.ts, 0, 0)) yield; diff --git a/tests/baselines/reference/generatorTypeCheck19.symbols b/tests/baselines/reference/generatorTypeCheck19.symbols index bb72f4b5646d1..d9cf5ea03e497 100644 --- a/tests/baselines/reference/generatorTypeCheck19.symbols +++ b/tests/baselines/reference/generatorTypeCheck19.symbols @@ -10,7 +10,7 @@ class Bar extends Foo { y: string } function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck19.ts, 1, 35)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >Foo : Symbol(Foo, Decl(generatorTypeCheck19.ts, 0, 0)) yield; diff --git a/tests/baselines/reference/generatorTypeCheck2.symbols b/tests/baselines/reference/generatorTypeCheck2.symbols index 33c0200c0c9b5..e092a3a939c1f 100644 --- a/tests/baselines/reference/generatorTypeCheck2.symbols +++ b/tests/baselines/reference/generatorTypeCheck2.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck2.ts === function* g1(): Iterable { } >g1 : Symbol(g1, Decl(generatorTypeCheck2.ts, 0, 0)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/generatorTypeCheck20.symbols b/tests/baselines/reference/generatorTypeCheck20.symbols index b82c2e64b80be..34f0e8f625cf3 100644 --- a/tests/baselines/reference/generatorTypeCheck20.symbols +++ b/tests/baselines/reference/generatorTypeCheck20.symbols @@ -9,7 +9,7 @@ class Baz { z: number } function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck20.ts, 1, 23)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >Foo : Symbol(Foo, Decl(generatorTypeCheck20.ts, 0, 0)) yield; diff --git a/tests/baselines/reference/generatorTypeCheck21.symbols b/tests/baselines/reference/generatorTypeCheck21.symbols index d7a8c1fb131d5..0d36624402df9 100644 --- a/tests/baselines/reference/generatorTypeCheck21.symbols +++ b/tests/baselines/reference/generatorTypeCheck21.symbols @@ -10,7 +10,7 @@ class Bar extends Foo { y: string } function* g(): IterableIterator { >g : Symbol(g, Decl(generatorTypeCheck21.ts, 1, 35)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >Foo : Symbol(Foo, Decl(generatorTypeCheck21.ts, 0, 0)) yield; diff --git a/tests/baselines/reference/generatorTypeCheck25.symbols b/tests/baselines/reference/generatorTypeCheck25.symbols index ebbe92062eded..8cafe9e884991 100644 --- a/tests/baselines/reference/generatorTypeCheck25.symbols +++ b/tests/baselines/reference/generatorTypeCheck25.symbols @@ -14,7 +14,7 @@ class Baz { z: number } var g3: () => Iterable = function* () { >g3 : Symbol(g3, Decl(generatorTypeCheck25.ts, 3, 3)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >Foo : Symbol(Foo, Decl(generatorTypeCheck25.ts, 0, 0)) yield; diff --git a/tests/baselines/reference/generatorTypeCheck26.symbols b/tests/baselines/reference/generatorTypeCheck26.symbols index b5f5a65669ef6..78cc075c76f55 100644 --- a/tests/baselines/reference/generatorTypeCheck26.symbols +++ b/tests/baselines/reference/generatorTypeCheck26.symbols @@ -1,20 +1,20 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck26.ts === function* g(): IterableIterator<(x: string) => number> { >g : Symbol(g, Decl(generatorTypeCheck26.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck26.ts, 0, 33)) yield x => x.length; >x : Symbol(x, Decl(generatorTypeCheck26.ts, 1, 9)) ->x.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>x.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck26.ts, 1, 9)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) yield *[x => x.length]; >x : Symbol(x, Decl(generatorTypeCheck26.ts, 2, 12)) ->x.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>x.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck26.ts, 2, 12)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) return x => x.length; >x : Symbol(x, Decl(generatorTypeCheck26.ts, 3, 10)) diff --git a/tests/baselines/reference/generatorTypeCheck27.symbols b/tests/baselines/reference/generatorTypeCheck27.symbols index 58f5e56242385..82e142b15c351 100644 --- a/tests/baselines/reference/generatorTypeCheck27.symbols +++ b/tests/baselines/reference/generatorTypeCheck27.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck27.ts === function* g(): IterableIterator<(x: string) => number> { >g : Symbol(g, Decl(generatorTypeCheck27.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck27.ts, 0, 33)) yield * function* () { diff --git a/tests/baselines/reference/generatorTypeCheck28.symbols b/tests/baselines/reference/generatorTypeCheck28.symbols index c07d081924456..8f3b9f96948b8 100644 --- a/tests/baselines/reference/generatorTypeCheck28.symbols +++ b/tests/baselines/reference/generatorTypeCheck28.symbols @@ -1,20 +1,20 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck28.ts === function* g(): IterableIterator<(x: string) => number> { >g : Symbol(g, Decl(generatorTypeCheck28.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck28.ts, 0, 33)) yield * { *[Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) yield x => x.length; >x : Symbol(x, Decl(generatorTypeCheck28.ts, 3, 17)) ->x.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>x.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck28.ts, 3, 17)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) } }; } diff --git a/tests/baselines/reference/generatorTypeCheck29.symbols b/tests/baselines/reference/generatorTypeCheck29.symbols index 5ea31ccb0cd67..8f0304c0874b6 100644 --- a/tests/baselines/reference/generatorTypeCheck29.symbols +++ b/tests/baselines/reference/generatorTypeCheck29.symbols @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck29.ts === function* g2(): Iterator number>> { >g2 : Symbol(g2, Decl(generatorTypeCheck29.ts, 0, 0)) ->Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterator : Symbol(Iterator, Decl(lib.es6.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck29.ts, 0, 35)) yield function* () { diff --git a/tests/baselines/reference/generatorTypeCheck3.symbols b/tests/baselines/reference/generatorTypeCheck3.symbols index 4533e1d9d2ff2..6bd083eb812ca 100644 --- a/tests/baselines/reference/generatorTypeCheck3.symbols +++ b/tests/baselines/reference/generatorTypeCheck3.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck3.ts === function* g1(): IterableIterator { } >g1 : Symbol(g1, Decl(generatorTypeCheck3.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/generatorTypeCheck30.symbols b/tests/baselines/reference/generatorTypeCheck30.symbols index f1626cf067f86..76e02c243cfb3 100644 --- a/tests/baselines/reference/generatorTypeCheck30.symbols +++ b/tests/baselines/reference/generatorTypeCheck30.symbols @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck30.ts === function* g2(): Iterator number>> { >g2 : Symbol(g2, Decl(generatorTypeCheck30.ts, 0, 0)) ->Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterator : Symbol(Iterator, Decl(lib.es6.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck30.ts, 0, 35)) yield function* () { diff --git a/tests/baselines/reference/generatorTypeCheck31.symbols b/tests/baselines/reference/generatorTypeCheck31.symbols index 2cdc507cd7fec..ede40291591f4 100644 --- a/tests/baselines/reference/generatorTypeCheck31.symbols +++ b/tests/baselines/reference/generatorTypeCheck31.symbols @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck31.ts === function* g2(): Iterator<() => Iterable<(x: string) => number>> { >g2 : Symbol(g2, Decl(generatorTypeCheck31.ts, 0, 0)) ->Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterator : Symbol(Iterator, Decl(lib.es6.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck31.ts, 0, 41)) yield function* () { diff --git a/tests/baselines/reference/generatorTypeCheck45.symbols b/tests/baselines/reference/generatorTypeCheck45.symbols index fa8cdacfcd310..893b642cb993c 100644 --- a/tests/baselines/reference/generatorTypeCheck45.symbols +++ b/tests/baselines/reference/generatorTypeCheck45.symbols @@ -6,7 +6,7 @@ declare function foo(x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) >x : Symbol(x, Decl(generatorTypeCheck45.ts, 0, 27)) >T : Symbol(T, Decl(generatorTypeCheck45.ts, 0, 21)) >fun : Symbol(fun, Decl(generatorTypeCheck45.ts, 0, 32)) ->Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterator : Symbol(Iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck45.ts, 0, 54)) >T : Symbol(T, Decl(generatorTypeCheck45.ts, 0, 21)) >U : Symbol(U, Decl(generatorTypeCheck45.ts, 0, 23)) @@ -19,9 +19,9 @@ declare function foo(x: T, fun: () => Iterator<(x: T) => U>, fun2: (y: U) foo("", function* () { yield x => x.length }, p => undefined); // T is fixed, should be string >foo : Symbol(foo, Decl(generatorTypeCheck45.ts, 0, 0)) >x : Symbol(x, Decl(generatorTypeCheck45.ts, 2, 28)) ->x.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>x.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck45.ts, 2, 28)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(generatorTypeCheck45.ts, 2, 45)) >undefined : Symbol(undefined) diff --git a/tests/baselines/reference/generatorTypeCheck46.symbols b/tests/baselines/reference/generatorTypeCheck46.symbols index e2a10557c8601..c0aa592d48682 100644 --- a/tests/baselines/reference/generatorTypeCheck46.symbols +++ b/tests/baselines/reference/generatorTypeCheck46.symbols @@ -6,7 +6,7 @@ declare function foo(x: T, fun: () => Iterable<(x: T) => U>, fun2: (y: U) >x : Symbol(x, Decl(generatorTypeCheck46.ts, 0, 27)) >T : Symbol(T, Decl(generatorTypeCheck46.ts, 0, 21)) >fun : Symbol(fun, Decl(generatorTypeCheck46.ts, 0, 32)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck46.ts, 0, 54)) >T : Symbol(T, Decl(generatorTypeCheck46.ts, 0, 21)) >U : Symbol(U, Decl(generatorTypeCheck46.ts, 0, 23)) @@ -21,15 +21,15 @@ foo("", function* () { yield* { *[Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) yield x => x.length >x : Symbol(x, Decl(generatorTypeCheck46.ts, 5, 17)) ->x.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>x.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(generatorTypeCheck46.ts, 5, 17)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) } } }, p => undefined); // T is fixed, should be string diff --git a/tests/baselines/reference/generatorTypeCheck62.symbols b/tests/baselines/reference/generatorTypeCheck62.symbols index b8eb11d1f6743..ab07de3d4f4c7 100644 --- a/tests/baselines/reference/generatorTypeCheck62.symbols +++ b/tests/baselines/reference/generatorTypeCheck62.symbols @@ -14,11 +14,11 @@ export function strategy(stratName: string, gen: (a: T >gen : Symbol(gen, Decl(generatorTypeCheck62.ts, 4, 69)) >a : Symbol(a, Decl(generatorTypeCheck62.ts, 4, 76)) >T : Symbol(T, Decl(generatorTypeCheck62.ts, 4, 25)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(generatorTypeCheck62.ts, 4, 25)) >a : Symbol(a, Decl(generatorTypeCheck62.ts, 4, 120)) >T : Symbol(T, Decl(generatorTypeCheck62.ts, 4, 25)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(generatorTypeCheck62.ts, 4, 25)) return function*(state) { @@ -51,7 +51,7 @@ export interface Strategy { (a: T): IterableIterator; >a : Symbol(a, Decl(generatorTypeCheck62.ts, 16, 5)) >T : Symbol(T, Decl(generatorTypeCheck62.ts, 15, 26)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(generatorTypeCheck62.ts, 15, 26)) } diff --git a/tests/baselines/reference/generatorTypeCheck63.symbols b/tests/baselines/reference/generatorTypeCheck63.symbols index 4d825e2d056fd..e142a1b3bb006 100644 --- a/tests/baselines/reference/generatorTypeCheck63.symbols +++ b/tests/baselines/reference/generatorTypeCheck63.symbols @@ -14,11 +14,11 @@ export function strategy(stratName: string, gen: (a: T >gen : Symbol(gen, Decl(generatorTypeCheck63.ts, 4, 69)) >a : Symbol(a, Decl(generatorTypeCheck63.ts, 4, 76)) >T : Symbol(T, Decl(generatorTypeCheck63.ts, 4, 25)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(generatorTypeCheck63.ts, 4, 25)) >a : Symbol(a, Decl(generatorTypeCheck63.ts, 4, 120)) >T : Symbol(T, Decl(generatorTypeCheck63.ts, 4, 25)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(generatorTypeCheck63.ts, 4, 25)) return function*(state) { @@ -51,7 +51,7 @@ export interface Strategy { (a: T): IterableIterator; >a : Symbol(a, Decl(generatorTypeCheck63.ts, 16, 5)) >T : Symbol(T, Decl(generatorTypeCheck63.ts, 15, 26)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(generatorTypeCheck63.ts, 15, 26)) } diff --git a/tests/baselines/reference/generatorTypeCheck7.symbols b/tests/baselines/reference/generatorTypeCheck7.symbols index 0573de30b7c68..d81cbc05c0b11 100644 --- a/tests/baselines/reference/generatorTypeCheck7.symbols +++ b/tests/baselines/reference/generatorTypeCheck7.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck7.ts === interface WeirdIter extends IterableIterator { >WeirdIter : Symbol(WeirdIter, Decl(generatorTypeCheck7.ts, 0, 0)) ->IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>IterableIterator : Symbol(IterableIterator, Decl(lib.es6.d.ts, --, --)) hello: string; >hello : Symbol(WeirdIter.hello, Decl(generatorTypeCheck7.ts, 0, 54)) diff --git a/tests/baselines/reference/generatorTypeCheck8.symbols b/tests/baselines/reference/generatorTypeCheck8.symbols index 2938c6c0dc1fe..30d067805cd77 100644 --- a/tests/baselines/reference/generatorTypeCheck8.symbols +++ b/tests/baselines/reference/generatorTypeCheck8.symbols @@ -1,8 +1,8 @@ === tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts === interface BadGenerator extends Iterator, Iterable { } >BadGenerator : Symbol(BadGenerator, Decl(generatorTypeCheck8.ts, 0, 0)) ->Iterator : Symbol(Iterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterator : Symbol(Iterator, Decl(lib.es6.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) function* g3(): BadGenerator { } >g3 : Symbol(g3, Decl(generatorTypeCheck8.ts, 0, 69)) diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.symbols b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.symbols index e7e5b7d5b3edf..b61cb7746cf40 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.symbols +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.symbols @@ -33,13 +33,13 @@ var r3 = foo(new Object()); // {} var r4 = foo(1); // error >r4 : Symbol(r4, Decl(genericCallWithConstraintsTypeArgumentInference2.ts, 10, 3)) >foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r5 = foo(new Date()); // no error >r5 : Symbol(r5, Decl(genericCallWithConstraintsTypeArgumentInference2.ts, 11, 3)) >foo : Symbol(foo, Decl(genericCallWithConstraintsTypeArgumentInference2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.symbols b/tests/baselines/reference/genericCallWithGenericSignatureArguments.symbols index b814c700b8ea3..5921a53ae5f9f 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments.symbols +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.symbols @@ -109,7 +109,7 @@ function other(x: T) { function other2(x: T) { >other2 : Symbol(other2, Decl(genericCallWithGenericSignatureArguments.ts, 23, 1)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments.ts, 25, 16)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericCallWithGenericSignatureArguments.ts, 25, 32)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments.ts, 25, 16)) @@ -143,7 +143,7 @@ function other2(x: T) { function foo2(a: (x: T) => T, b: (x: T) => T) { >foo2 : Symbol(foo2, Decl(genericCallWithGenericSignatureArguments.ts, 31, 1)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments.ts, 34, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(genericCallWithGenericSignatureArguments.ts, 34, 30)) >x : Symbol(x, Decl(genericCallWithGenericSignatureArguments.ts, 34, 34)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments.ts, 34, 14)) @@ -174,9 +174,9 @@ function other3(x: T) { >r8 : Symbol(r8, Decl(genericCallWithGenericSignatureArguments.ts, 40, 7)) >foo2 : Symbol(foo2, Decl(genericCallWithGenericSignatureArguments.ts, 31, 1)) >a : Symbol(a, Decl(genericCallWithGenericSignatureArguments.ts, 40, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(genericCallWithGenericSignatureArguments.ts, 40, 19)) >b : Symbol(b, Decl(genericCallWithGenericSignatureArguments.ts, 40, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(genericCallWithGenericSignatureArguments.ts, 40, 35)) } diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.symbols b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.symbols index db4bcac853ed0..8167765041dd2 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.symbols +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.symbols @@ -37,7 +37,7 @@ module onlyT { function other2(x: T) { >other2 : Symbol(other2, Decl(genericCallWithGenericSignatureArguments2.ts, 9, 69)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments2.ts, 11, 20)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericCallWithGenericSignatureArguments2.ts, 11, 36)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments2.ts, 11, 20)) @@ -55,7 +55,7 @@ module onlyT { var r9 = r7(new Date()); // should be ok >r9 : Symbol(r9, Decl(genericCallWithGenericSignatureArguments2.ts, 14, 11)) >r7 : Symbol(r7, Decl(genericCallWithGenericSignatureArguments2.ts, 12, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r10 = r7(1); // error >r10 : Symbol(r10, Decl(genericCallWithGenericSignatureArguments2.ts, 15, 11)) @@ -65,7 +65,7 @@ module onlyT { function foo2(a: (x: T) => T, b: (x: T) => T) { >foo2 : Symbol(foo2, Decl(genericCallWithGenericSignatureArguments2.ts, 16, 5)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments2.ts, 18, 18)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(genericCallWithGenericSignatureArguments2.ts, 18, 34)) >x : Symbol(x, Decl(genericCallWithGenericSignatureArguments2.ts, 18, 38)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments2.ts, 18, 18)) @@ -195,7 +195,7 @@ module TU { function other2(x: T) { >other2 : Symbol(other2, Decl(genericCallWithGenericSignatureArguments2.ts, 45, 69)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments2.ts, 47, 20)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericCallWithGenericSignatureArguments2.ts, 47, 36)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments2.ts, 47, 20)) @@ -212,7 +212,7 @@ module TU { var r9 = r7(new Date()); >r9 : Symbol(r9, Decl(genericCallWithGenericSignatureArguments2.ts, 49, 11)) >r7 : Symbol(r7, Decl(genericCallWithGenericSignatureArguments2.ts, 48, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r10 = r7(1); >r10 : Symbol(r10, Decl(genericCallWithGenericSignatureArguments2.ts, 50, 11)) @@ -222,9 +222,9 @@ module TU { function foo2(a: (x: T) => T, b: (x: U) => U) { >foo2 : Symbol(foo2, Decl(genericCallWithGenericSignatureArguments2.ts, 51, 5)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments2.ts, 53, 18)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(genericCallWithGenericSignatureArguments2.ts, 53, 33)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(genericCallWithGenericSignatureArguments2.ts, 53, 50)) >x : Symbol(x, Decl(genericCallWithGenericSignatureArguments2.ts, 53, 54)) >T : Symbol(T, Decl(genericCallWithGenericSignatureArguments2.ts, 53, 18)) diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols index 4aa4807b637cb..2e0c6b86cf61b 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexers.symbols @@ -20,7 +20,7 @@ var a: { [x: number]: Date; >x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 8, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }; var r = foo(a); @@ -31,7 +31,7 @@ var r = foo(a); function other(arg: T) { >other : Symbol(other, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 10, 15)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 31)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexers.ts, 12, 15)) diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.symbols index e8371f0cf762a..b1465624a0909 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.symbols +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.symbols @@ -40,7 +40,7 @@ function other3(arg: T) { >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 16)) >U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 28)) >U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 28)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 45)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndIndexersErrors.ts, 14, 16)) diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols index 58d9d2a37708c..6dc56a2c05d1c 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.symbols @@ -14,7 +14,7 @@ function foo(x: T) { var a: { [x: number]: Date }; >a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 6, 3)) >x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 6, 10)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r = foo(a); >r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 7, 3)) @@ -41,7 +41,7 @@ function other(arg: T) { function other2(arg: T) { >other2 : Symbol(other2, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 12, 1)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 16)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 32)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 14, 16)) @@ -63,9 +63,9 @@ function other2(arg: T) { function other3(arg: T) { >other3 : Symbol(other3, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 18, 1)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 16)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 31)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 48)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndNumericIndexer.ts, 20, 16)) diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols index 56f1015f62041..b680e367dc9bc 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.symbols @@ -14,7 +14,7 @@ function foo(x: T) { var a: { [x: string]: Date }; >a : Symbol(a, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 6, 3)) >x : Symbol(x, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 6, 10)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r = foo(a); >r : Symbol(r, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 7, 3)) @@ -41,7 +41,7 @@ function other(arg: T) { function other2(arg: T) { >other2 : Symbol(other2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 12, 1)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 16)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 32)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 14, 16)) @@ -57,16 +57,16 @@ function other2(arg: T) { var d: Date = r2['hm']; // ok >d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 17, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 16, 7)) } function other3(arg: T) { >other3 : Symbol(other3, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 18, 1)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 16)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 31)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >arg : Symbol(arg, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 48)) >T : Symbol(T, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 20, 16)) @@ -82,7 +82,7 @@ function other3(arg: T) { var d: Date = r2['hm']; // ok >d : Symbol(d, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 23, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >r2 : Symbol(r2, Decl(genericCallWithObjectTypeArgsAndStringIndexer.ts, 22, 7)) // BUG 821629 diff --git a/tests/baselines/reference/genericCombinators2.symbols b/tests/baselines/reference/genericCombinators2.symbols index 63ced3de726ba..727d9dd2775bf 100644 --- a/tests/baselines/reference/genericCombinators2.symbols +++ b/tests/baselines/reference/genericCombinators2.symbols @@ -81,7 +81,7 @@ var r5a = _.map(c2, (x, y) => { return x.toFixed() }); >_.map : Symbol(Combinators.map, Decl(genericCombinators2.ts, 6, 23), Decl(genericCombinators2.ts, 7, 81)) >_ : Symbol(_, Decl(genericCombinators2.ts, 11, 3)) >map : Symbol(Combinators.map, Decl(genericCombinators2.ts, 6, 23), Decl(genericCombinators2.ts, 7, 81)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >c2 : Symbol(c2, Decl(genericCombinators2.ts, 12, 3)) >x : Symbol(x, Decl(genericCombinators2.ts, 14, 43)) >y : Symbol(y, Decl(genericCombinators2.ts, 14, 45)) @@ -94,7 +94,7 @@ var r5b = _.map(c2, rf1); >_.map : Symbol(Combinators.map, Decl(genericCombinators2.ts, 6, 23), Decl(genericCombinators2.ts, 7, 81)) >_ : Symbol(_, Decl(genericCombinators2.ts, 11, 3)) >map : Symbol(Combinators.map, Decl(genericCombinators2.ts, 6, 23), Decl(genericCombinators2.ts, 7, 81)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >c2 : Symbol(c2, Decl(genericCombinators2.ts, 12, 3)) >rf1 : Symbol(rf1, Decl(genericCombinators2.ts, 13, 3)) diff --git a/tests/baselines/reference/genericConstructorFunction1.symbols b/tests/baselines/reference/genericConstructorFunction1.symbols index f1e0efcc148b8..a6f177889de48 100644 --- a/tests/baselines/reference/genericConstructorFunction1.symbols +++ b/tests/baselines/reference/genericConstructorFunction1.symbols @@ -10,7 +10,7 @@ function f1(args: T) { >index : Symbol(index, Decl(genericConstructorFunction1.ts, 1, 15)) >arg : Symbol(arg, Decl(genericConstructorFunction1.ts, 1, 36)) >T : Symbol(T, Decl(genericConstructorFunction1.ts, 0, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var v2 = v1['test']; >v2 : Symbol(v2, Decl(genericConstructorFunction1.ts, 2, 7)) @@ -31,7 +31,7 @@ interface I1 { new (arg: T): Date }; >T : Symbol(T, Decl(genericConstructorFunction1.ts, 8, 13)) >arg : Symbol(arg, Decl(genericConstructorFunction1.ts, 8, 23)) >T : Symbol(T, Decl(genericConstructorFunction1.ts, 8, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function f2(args: T) { >f2 : Symbol(f2, Decl(genericConstructorFunction1.ts, 8, 39)) diff --git a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt index a0c5cbb437803..c84308189838f 100644 --- a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt +++ b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.errors.txt @@ -1,9 +1,8 @@ tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts(6,1): error TS2322: Type '() => S[]' is not assignable to type '(x: T) => T'. Type '{}[]' is not assignable to type 'T'. -tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts(10,1): error TS2304: Cannot find name 'console'. -==== tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts (2 errors) ==== +==== tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts (1 errors) ==== interface Array {} var f : { (x:T): T; } @@ -17,6 +16,4 @@ tests/cases/compiler/genericFunctionCallSignatureReturnTypeMismatch.ts(10,1): er var s = f("str").toUpperCase(); console.log(s); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.symbols b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.symbols index 69e5a66b013fd..159600212638b 100644 --- a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.symbols +++ b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.symbols @@ -26,5 +26,8 @@ var s = f("str").toUpperCase(); >toUpperCase : Symbol(String.toUpperCase, Decl(lib.d.ts, --, --)) console.log(s); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >s : Symbol(s, Decl(genericFunctionCallSignatureReturnTypeMismatch.ts, 7, 3)) diff --git a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.types b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.types index 6e999e229ac00..3a521adaf7f81 100644 --- a/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.types +++ b/tests/baselines/reference/genericFunctionCallSignatureReturnTypeMismatch.types @@ -30,9 +30,9 @@ var s = f("str").toUpperCase(); >toUpperCase : () => string console.log(s); ->console.log(s) : any ->console.log : any ->console : any ->log : any +>console.log(s) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >s : string diff --git a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols index 398c3a0e71fb2..7b3184d7bd363 100644 --- a/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols +++ b/tests/baselines/reference/genericFunctionsWithOptionalParameters3.symbols @@ -63,7 +63,7 @@ var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); >c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) >x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 9, 29)) >y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 9, 50)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return new Date() }); >r4 : Symbol(r4, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 3)) @@ -73,7 +73,7 @@ var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return >c : Symbol(c, Decl(genericFunctionsWithOptionalParameters3.ts, 8, 3)) >x : Symbol(x, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 29)) >y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 10, 58)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var f1 = (x: string) => { return 1 }; >f1 : Symbol(f1, Decl(genericFunctionsWithOptionalParameters3.ts, 11, 3)) @@ -82,7 +82,7 @@ var f1 = (x: string) => { return 1 }; var f2 = (y: number) => { return new Date() }; >f2 : Symbol(f2, Decl(genericFunctionsWithOptionalParameters3.ts, 12, 3)) >y : Symbol(y, Decl(genericFunctionsWithOptionalParameters3.ts, 12, 10)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r5 = utils.mapReduce(c, f1, f2); >r5 : Symbol(r5, Decl(genericFunctionsWithOptionalParameters3.ts, 13, 3)) diff --git a/tests/baselines/reference/genericMethodOverspecialization.symbols b/tests/baselines/reference/genericMethodOverspecialization.symbols index 9cf7bb995b15f..89b0541780c56 100644 --- a/tests/baselines/reference/genericMethodOverspecialization.symbols +++ b/tests/baselines/reference/genericMethodOverspecialization.symbols @@ -27,9 +27,9 @@ interface Document { var elements = names.map(function (name) { >elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) ->names.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>names.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >names : Symbol(names, Decl(genericMethodOverspecialization.ts, 0, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >name : Symbol(name, Decl(genericMethodOverspecialization.ts, 12, 35)) return document.getElementById(name); @@ -43,9 +43,9 @@ var elements = names.map(function (name) { var xxx = elements.filter(function (e) { >xxx : Symbol(xxx, Decl(genericMethodOverspecialization.ts, 17, 3)) ->elements.filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>elements.filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) ->filter : Symbol(Array.filter, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >e : Symbol(e, Decl(genericMethodOverspecialization.ts, 17, 36)) return !e.isDisabled; @@ -57,9 +57,9 @@ var xxx = elements.filter(function (e) { var widths:number[] = elements.map(function (e) { // should not error >widths : Symbol(widths, Decl(genericMethodOverspecialization.ts, 21, 3)) ->elements.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>elements.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >elements : Symbol(elements, Decl(genericMethodOverspecialization.ts, 12, 3)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >e : Symbol(e, Decl(genericMethodOverspecialization.ts, 21, 45)) return e.clientWidth; diff --git a/tests/baselines/reference/genericPrototypeProperty2.symbols b/tests/baselines/reference/genericPrototypeProperty2.symbols index 71709239cefb2..b6957e6984093 100644 --- a/tests/baselines/reference/genericPrototypeProperty2.symbols +++ b/tests/baselines/reference/genericPrototypeProperty2.symbols @@ -1,6 +1,6 @@ === tests/cases/compiler/genericPrototypeProperty2.ts === interface EventTarget { x } ->EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +>EventTarget : Symbol(EventTarget, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(genericPrototypeProperty2.ts, 0, 0)) >x : Symbol(EventTarget.x, Decl(genericPrototypeProperty2.ts, 0, 23)) class BaseEvent { @@ -8,13 +8,13 @@ class BaseEvent { target: EventTarget; >target : Symbol(BaseEvent.target, Decl(genericPrototypeProperty2.ts, 1, 17)) ->EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +>EventTarget : Symbol(EventTarget, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(genericPrototypeProperty2.ts, 0, 0)) } class MyEvent extends BaseEvent { >MyEvent : Symbol(MyEvent, Decl(genericPrototypeProperty2.ts, 3, 1)) >T : Symbol(T, Decl(genericPrototypeProperty2.ts, 5, 14)) ->EventTarget : Symbol(EventTarget, Decl(genericPrototypeProperty2.ts, 0, 0)) +>EventTarget : Symbol(EventTarget, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(genericPrototypeProperty2.ts, 0, 0)) >BaseEvent : Symbol(BaseEvent, Decl(genericPrototypeProperty2.ts, 0, 27)) target: T; diff --git a/tests/baselines/reference/genericSignatureIdentity.symbols b/tests/baselines/reference/genericSignatureIdentity.symbols index b5caa87b0a555..a5e9d289c3c2d 100644 --- a/tests/baselines/reference/genericSignatureIdentity.symbols +++ b/tests/baselines/reference/genericSignatureIdentity.symbols @@ -9,7 +9,7 @@ var x: { (x: T): T; >T : Symbol(T, Decl(genericSignatureIdentity.ts, 6, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericSignatureIdentity.ts, 6, 21)) >T : Symbol(T, Decl(genericSignatureIdentity.ts, 6, 5)) >T : Symbol(T, Decl(genericSignatureIdentity.ts, 6, 5)) diff --git a/tests/baselines/reference/genericTypeAssertions6.symbols b/tests/baselines/reference/genericTypeAssertions6.symbols index c7b523b3c5368..764988fe42d16 100644 --- a/tests/baselines/reference/genericTypeAssertions6.symbols +++ b/tests/baselines/reference/genericTypeAssertions6.symbols @@ -40,9 +40,9 @@ class A { class B extends A { >B : Symbol(B, Decl(genericTypeAssertions6.ts, 10, 1)) >T : Symbol(T, Decl(genericTypeAssertions6.ts, 12, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(genericTypeAssertions6.ts, 12, 23)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >A : Symbol(A, Decl(genericTypeAssertions6.ts, 0, 0)) >T : Symbol(T, Decl(genericTypeAssertions6.ts, 12, 8)) >U : Symbol(U, Decl(genericTypeAssertions6.ts, 12, 23)) @@ -54,45 +54,45 @@ class B extends A { var a: Date = x; >a : Symbol(a, Decl(genericTypeAssertions6.ts, 14, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericTypeAssertions6.ts, 13, 6)) var b = x; >b : Symbol(b, Decl(genericTypeAssertions6.ts, 15, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericTypeAssertions6.ts, 13, 6)) var c = new Date(); >c : Symbol(c, Decl(genericTypeAssertions6.ts, 16, 11)) >T : Symbol(T, Decl(genericTypeAssertions6.ts, 12, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var d = new Date(); >d : Symbol(d, Decl(genericTypeAssertions6.ts, 17, 11)) >U : Symbol(U, Decl(genericTypeAssertions6.ts, 12, 23)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var e = new Date(); >e : Symbol(e, Decl(genericTypeAssertions6.ts, 18, 11)) >T : Symbol(T, Decl(genericTypeAssertions6.ts, 12, 8)) >U : Symbol(U, Decl(genericTypeAssertions6.ts, 12, 23)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } } var b: B; >b : Symbol(b, Decl(genericTypeAssertions6.ts, 22, 3)) >B : Symbol(B, Decl(genericTypeAssertions6.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var c: A = >b; >c : Symbol(c, Decl(genericTypeAssertions6.ts, 23, 3)) >A : Symbol(A, Decl(genericTypeAssertions6.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >A : Symbol(A, Decl(genericTypeAssertions6.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(genericTypeAssertions6.ts, 22, 3)) diff --git a/tests/baselines/reference/importCallExpression4ESNext.js b/tests/baselines/reference/importCallExpression4ESNext.js index d5d4a51d69f0b..92298381c3de9 100644 --- a/tests/baselines/reference/importCallExpression4ESNext.js +++ b/tests/baselines/reference/importCallExpression4ESNext.js @@ -11,7 +11,6 @@ export function foo() { return "foo" } export function backup() { return "backup"; } //// [2.ts] -declare var console: any; class C { private myModule = import("./0"); method() { diff --git a/tests/baselines/reference/importCallExpression4ESNext.symbols b/tests/baselines/reference/importCallExpression4ESNext.symbols index ef8d6e9c50905..a6dc98b52ed1d 100644 --- a/tests/baselines/reference/importCallExpression4ESNext.symbols +++ b/tests/baselines/reference/importCallExpression4ESNext.symbols @@ -14,52 +14,55 @@ export function backup() { return "backup"; } >backup : Symbol(backup, Decl(1.ts, 0, 0)) === tests/cases/conformance/dynamicImport/2.ts === -declare var console: any; ->console : Symbol(console, Decl(2.ts, 0, 11)) - class C { ->C : Symbol(C, Decl(2.ts, 0, 25)) +>C : Symbol(C, Decl(2.ts, 0, 0)) private myModule = import("./0"); ->myModule : Symbol(C.myModule, Decl(2.ts, 1, 9)) +>myModule : Symbol(C.myModule, Decl(2.ts, 0, 9)) >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) method() { ->method : Symbol(C.method, Decl(2.ts, 2, 37)) +>method : Symbol(C.method, Decl(2.ts, 1, 37)) const loadAsync = import ("./0"); ->loadAsync : Symbol(loadAsync, Decl(2.ts, 4, 13)) +>loadAsync : Symbol(loadAsync, Decl(2.ts, 3, 13)) >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) this.myModule.then(Zero => { >this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->this.myModule : Symbol(C.myModule, Decl(2.ts, 1, 9)) ->this : Symbol(C, Decl(2.ts, 0, 25)) ->myModule : Symbol(C.myModule, Decl(2.ts, 1, 9)) +>this.myModule : Symbol(C.myModule, Decl(2.ts, 0, 9)) +>this : Symbol(C, Decl(2.ts, 0, 0)) +>myModule : Symbol(C.myModule, Decl(2.ts, 0, 9)) >then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Zero : Symbol(Zero, Decl(2.ts, 5, 27)) +>Zero : Symbol(Zero, Decl(2.ts, 4, 27)) console.log(Zero.foo()); ->console : Symbol(console, Decl(2.ts, 0, 11)) +>console.log : Symbol(Console.log, Decl(lib.esnext.full.d.ts, --, --)) +>console : Symbol(console, Decl(lib.esnext.full.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.esnext.full.d.ts, --, --)) >Zero.foo : Symbol(foo, Decl(0.ts, 2, 1)) ->Zero : Symbol(Zero, Decl(2.ts, 5, 27)) +>Zero : Symbol(Zero, Decl(2.ts, 4, 27)) >foo : Symbol(foo, Decl(0.ts, 2, 1)) }, async err => { ->err : Symbol(err, Decl(2.ts, 7, 16)) +>err : Symbol(err, Decl(2.ts, 6, 16)) console.log(err); ->console : Symbol(console, Decl(2.ts, 0, 11)) ->err : Symbol(err, Decl(2.ts, 7, 16)) +>console.log : Symbol(Console.log, Decl(lib.esnext.full.d.ts, --, --)) +>console : Symbol(console, Decl(lib.esnext.full.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.esnext.full.d.ts, --, --)) +>err : Symbol(err, Decl(2.ts, 6, 16)) let one = await import("./1"); ->one : Symbol(one, Decl(2.ts, 9, 15)) +>one : Symbol(one, Decl(2.ts, 8, 15)) >"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0)) console.log(one.backup()); ->console : Symbol(console, Decl(2.ts, 0, 11)) +>console.log : Symbol(Console.log, Decl(lib.esnext.full.d.ts, --, --)) +>console : Symbol(console, Decl(lib.esnext.full.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.esnext.full.d.ts, --, --)) >one.backup : Symbol(backup, Decl(1.ts, 0, 0)) ->one : Symbol(one, Decl(2.ts, 9, 15)) +>one : Symbol(one, Decl(2.ts, 8, 15)) >backup : Symbol(backup, Decl(1.ts, 0, 0)) }); diff --git a/tests/baselines/reference/importCallExpression4ESNext.types b/tests/baselines/reference/importCallExpression4ESNext.types index 74cc6ff8b28fa..00d6ce707d3ea 100644 --- a/tests/baselines/reference/importCallExpression4ESNext.types +++ b/tests/baselines/reference/importCallExpression4ESNext.types @@ -17,9 +17,6 @@ export function backup() { return "backup"; } >"backup" : "backup" === tests/cases/conformance/dynamicImport/2.ts === -declare var console: any; ->console : any - class C { >C : C @@ -47,10 +44,10 @@ class C { >Zero : typeof "tests/cases/conformance/dynamicImport/0" console.log(Zero.foo()); ->console.log(Zero.foo()) : any ->console.log : any ->console : any ->log : any +>console.log(Zero.foo()) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >Zero.foo() : string >Zero.foo : () => string >Zero : typeof "tests/cases/conformance/dynamicImport/0" @@ -61,10 +58,10 @@ class C { >err : any console.log(err); ->console.log(err) : any ->console.log : any ->console : any ->log : any +>console.log(err) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >err : any let one = await import("./1"); @@ -74,10 +71,10 @@ class C { >"./1" : "./1" console.log(one.backup()); ->console.log(one.backup()) : any ->console.log : any ->console : any ->log : any +>console.log(one.backup()) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >one.backup() : string >one.backup : () => string >one : typeof "tests/cases/conformance/dynamicImport/1" diff --git a/tests/baselines/reference/importCallExpressionCheckReturntype1.symbols b/tests/baselines/reference/importCallExpressionCheckReturntype1.symbols index 566f1aa5ca12e..4a271e6bd4949 100644 --- a/tests/baselines/reference/importCallExpressionCheckReturntype1.symbols +++ b/tests/baselines/reference/importCallExpressionCheckReturntype1.symbols @@ -15,18 +15,18 @@ import * as anotherModule from "./anotherModule"; let p1: Promise = import("./defaultPath"); >p1 : Symbol(p1, Decl(1.ts, 3, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >anotherModule : Symbol(anotherModule, Decl(1.ts, 1, 6)) >"./defaultPath" : Symbol(defaultModule, Decl(defaultPath.ts, 0, 0)) let p2 = import("./defaultPath") as Promise; >p2 : Symbol(p2, Decl(1.ts, 4, 3)) >"./defaultPath" : Symbol(defaultModule, Decl(defaultPath.ts, 0, 0)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >anotherModule : Symbol(anotherModule, Decl(1.ts, 1, 6)) let p3: Promise = import("./defaultPath"); >p3 : Symbol(p3, Decl(1.ts, 5, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >"./defaultPath" : Symbol(defaultModule, Decl(defaultPath.ts, 0, 0)) diff --git a/tests/baselines/reference/importCallExpressionES6AMD.symbols b/tests/baselines/reference/importCallExpressionES6AMD.symbols index 2f8bd23758ddb..bac881bbcb9a1 100644 --- a/tests/baselines/reference/importCallExpressionES6AMD.symbols +++ b/tests/baselines/reference/importCallExpressionES6AMD.symbols @@ -11,9 +11,9 @@ var p1 = import("./0"); >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) p1.then(zero => { ->p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p1.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p1 : Symbol(p1, Decl(1.ts, 1, 3)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >zero : Symbol(zero, Decl(1.ts, 2, 8)) return zero.foo(); diff --git a/tests/baselines/reference/importCallExpressionES6CJS.symbols b/tests/baselines/reference/importCallExpressionES6CJS.symbols index 2f8bd23758ddb..bac881bbcb9a1 100644 --- a/tests/baselines/reference/importCallExpressionES6CJS.symbols +++ b/tests/baselines/reference/importCallExpressionES6CJS.symbols @@ -11,9 +11,9 @@ var p1 = import("./0"); >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) p1.then(zero => { ->p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p1.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p1 : Symbol(p1, Decl(1.ts, 1, 3)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >zero : Symbol(zero, Decl(1.ts, 2, 8)) return zero.foo(); diff --git a/tests/baselines/reference/importCallExpressionES6System.symbols b/tests/baselines/reference/importCallExpressionES6System.symbols index 2f8bd23758ddb..bac881bbcb9a1 100644 --- a/tests/baselines/reference/importCallExpressionES6System.symbols +++ b/tests/baselines/reference/importCallExpressionES6System.symbols @@ -11,9 +11,9 @@ var p1 = import("./0"); >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) p1.then(zero => { ->p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p1.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p1 : Symbol(p1, Decl(1.ts, 1, 3)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >zero : Symbol(zero, Decl(1.ts, 2, 8)) return zero.foo(); diff --git a/tests/baselines/reference/importCallExpressionES6UMD.symbols b/tests/baselines/reference/importCallExpressionES6UMD.symbols index 2f8bd23758ddb..bac881bbcb9a1 100644 --- a/tests/baselines/reference/importCallExpressionES6UMD.symbols +++ b/tests/baselines/reference/importCallExpressionES6UMD.symbols @@ -11,9 +11,9 @@ var p1 = import("./0"); >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) p1.then(zero => { ->p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p1.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p1 : Symbol(p1, Decl(1.ts, 1, 3)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >zero : Symbol(zero, Decl(1.ts, 2, 8)) return zero.foo(); diff --git a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.errors.txt b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.errors.txt index b422869ff2188..4e8496ce74219 100644 --- a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.errors.txt +++ b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.errors.txt @@ -1,8 +1,8 @@ error TS2468: Cannot find global value 'Promise'. -tests/cases/conformance/dynamicImport/2.ts(3,24): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. -tests/cases/conformance/dynamicImport/2.ts(5,27): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. -tests/cases/conformance/dynamicImport/2.ts(8,12): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. -tests/cases/conformance/dynamicImport/2.ts(10,29): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. +tests/cases/conformance/dynamicImport/2.ts(2,24): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. +tests/cases/conformance/dynamicImport/2.ts(4,27): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. +tests/cases/conformance/dynamicImport/2.ts(7,12): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. +tests/cases/conformance/dynamicImport/2.ts(9,29): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option. !!! error TS2468: Cannot find global value 'Promise'. @@ -17,7 +17,6 @@ tests/cases/conformance/dynamicImport/2.ts(10,29): error TS2712: A dynamic impor export function backup() { return "backup"; } ==== tests/cases/conformance/dynamicImport/2.ts (4 errors) ==== - declare var console: any; class C { private myModule = import("./0"); ~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.js b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.js index 3135a4066fd39..65f69fea4ca21 100644 --- a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.js +++ b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.js @@ -11,7 +11,6 @@ export function foo() { return "foo" } export function backup() { return "backup"; } //// [2.ts] -declare var console: any; class C { private myModule = import("./0"); method() { diff --git a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.symbols b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.symbols index a30acb72d2cbf..fb5a12e2e22fe 100644 --- a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.symbols +++ b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.symbols @@ -14,52 +14,55 @@ export function backup() { return "backup"; } >backup : Symbol(backup, Decl(1.ts, 0, 0)) === tests/cases/conformance/dynamicImport/2.ts === -declare var console: any; ->console : Symbol(console, Decl(2.ts, 0, 11)) - class C { ->C : Symbol(C, Decl(2.ts, 0, 25)) +>C : Symbol(C, Decl(2.ts, 0, 0)) private myModule = import("./0"); ->myModule : Symbol(C.myModule, Decl(2.ts, 1, 9)) +>myModule : Symbol(C.myModule, Decl(2.ts, 0, 9)) >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) method() { ->method : Symbol(C.method, Decl(2.ts, 2, 37)) +>method : Symbol(C.method, Decl(2.ts, 1, 37)) const loadAsync = import("./0"); ->loadAsync : Symbol(loadAsync, Decl(2.ts, 4, 13)) +>loadAsync : Symbol(loadAsync, Decl(2.ts, 3, 13)) >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) this.myModule.then(Zero => { >this.myModule.then : Symbol(Promise.then, Decl(lib.d.ts, --, --)) ->this.myModule : Symbol(C.myModule, Decl(2.ts, 1, 9)) ->this : Symbol(C, Decl(2.ts, 0, 25)) ->myModule : Symbol(C.myModule, Decl(2.ts, 1, 9)) +>this.myModule : Symbol(C.myModule, Decl(2.ts, 0, 9)) +>this : Symbol(C, Decl(2.ts, 0, 0)) +>myModule : Symbol(C.myModule, Decl(2.ts, 0, 9)) >then : Symbol(Promise.then, Decl(lib.d.ts, --, --)) ->Zero : Symbol(Zero, Decl(2.ts, 5, 27)) +>Zero : Symbol(Zero, Decl(2.ts, 4, 27)) console.log(Zero.foo()); ->console : Symbol(console, Decl(2.ts, 0, 11)) +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >Zero.foo : Symbol(foo, Decl(0.ts, 2, 1)) ->Zero : Symbol(Zero, Decl(2.ts, 5, 27)) +>Zero : Symbol(Zero, Decl(2.ts, 4, 27)) >foo : Symbol(foo, Decl(0.ts, 2, 1)) }, async err => { ->err : Symbol(err, Decl(2.ts, 7, 16)) +>err : Symbol(err, Decl(2.ts, 6, 16)) console.log(err); ->console : Symbol(console, Decl(2.ts, 0, 11)) ->err : Symbol(err, Decl(2.ts, 7, 16)) +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>err : Symbol(err, Decl(2.ts, 6, 16)) let one = await import("./1"); ->one : Symbol(one, Decl(2.ts, 9, 15)) +>one : Symbol(one, Decl(2.ts, 8, 15)) >"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0)) console.log(one.backup()); ->console : Symbol(console, Decl(2.ts, 0, 11)) +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >one.backup : Symbol(backup, Decl(1.ts, 0, 0)) ->one : Symbol(one, Decl(2.ts, 9, 15)) +>one : Symbol(one, Decl(2.ts, 8, 15)) >backup : Symbol(backup, Decl(1.ts, 0, 0)) }); diff --git a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.types b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.types index 552e3cf9206ca..bf0a421cd0f20 100644 --- a/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.types +++ b/tests/baselines/reference/importCallExpressionNoModuleKindSpecified.types @@ -17,9 +17,6 @@ export function backup() { return "backup"; } >"backup" : "backup" === tests/cases/conformance/dynamicImport/2.ts === -declare var console: any; ->console : any - class C { >C : C @@ -47,10 +44,10 @@ class C { >Zero : typeof "tests/cases/conformance/dynamicImport/0" console.log(Zero.foo()); ->console.log(Zero.foo()) : any ->console.log : any ->console : any ->log : any +>console.log(Zero.foo()) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >Zero.foo() : string >Zero.foo : () => string >Zero : typeof "tests/cases/conformance/dynamicImport/0" @@ -61,10 +58,10 @@ class C { >err : any console.log(err); ->console.log(err) : any ->console.log : any ->console : any ->log : any +>console.log(err) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >err : any let one = await import("./1"); @@ -74,10 +71,10 @@ class C { >"./1" : "./1" console.log(one.backup()); ->console.log(one.backup()) : any ->console.log : any ->console : any ->log : any +>console.log(one.backup()) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >one.backup() : string >one.backup : () => string >one : typeof "tests/cases/conformance/dynamicImport/1" diff --git a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.symbols b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.symbols index 3cb4d99ad25fe..69a657da40d3f 100644 --- a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.symbols +++ b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.symbols @@ -33,12 +33,12 @@ var p1 = import(ValidSomeCondition() ? "./0" : "externalModule"); var p1: Promise = import(getSpecifier()); >p1 : Symbol(p1, Decl(1.ts, 10, 3), Decl(1.ts, 11, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >getSpecifier : Symbol(getSpecifier, Decl(1.ts, 0, 47)) var p11: Promise = import(getSpecifier()); >p11 : Symbol(p11, Decl(1.ts, 12, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >defaultModule : Symbol(defaultModule, Decl(1.ts, 0, 6)) >getSpecifier : Symbol(getSpecifier, Decl(1.ts, 0, 47)) @@ -46,13 +46,13 @@ const p2 = import(whatToLoad ? getSpecifier() : "defaulPath") as Promisep2 : Symbol(p2, Decl(1.ts, 13, 5)) >whatToLoad : Symbol(whatToLoad, Decl(1.ts, 3, 11)) >getSpecifier : Symbol(getSpecifier, Decl(1.ts, 0, 47)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >defaultModule : Symbol(defaultModule, Decl(1.ts, 0, 6)) p1.then(zero => { ->p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p1.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p1 : Symbol(p1, Decl(1.ts, 10, 3), Decl(1.ts, 11, 3)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >zero : Symbol(zero, Decl(1.ts, 14, 8)) return zero.foo(); // ok, zero is any @@ -65,7 +65,7 @@ let j: string; var p3: Promise = import(j=getSpecifier()); >p3 : Symbol(p3, Decl(1.ts, 19, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >defaultModule : Symbol(defaultModule, Decl(1.ts, 0, 6)) >j : Symbol(j, Decl(1.ts, 18, 3)) >getSpecifier : Symbol(getSpecifier, Decl(1.ts, 0, 47)) diff --git a/tests/baselines/reference/importCallExpressionShouldNotGetParen.symbols b/tests/baselines/reference/importCallExpressionShouldNotGetParen.symbols index ace34efcf0d80..7e83ad1b12507 100644 --- a/tests/baselines/reference/importCallExpressionShouldNotGetParen.symbols +++ b/tests/baselines/reference/importCallExpressionShouldNotGetParen.symbols @@ -3,9 +3,9 @@ const localeName = "zh-CN"; >localeName : Symbol(localeName, Decl(importCallExpressionShouldNotGetParen.ts, 0, 5)) import(`./locales/${localeName}.js`).then(bar => { ->import(`./locales/${localeName}.js`).then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>import(`./locales/${localeName}.js`).then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >localeName : Symbol(localeName, Decl(importCallExpressionShouldNotGetParen.ts, 0, 5)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >bar : Symbol(bar, Decl(importCallExpressionShouldNotGetParen.ts, 1, 42)) let x = bar; @@ -15,9 +15,9 @@ import(`./locales/${localeName}.js`).then(bar => { }); import("./locales/" + localeName + ".js").then(bar => { ->import("./locales/" + localeName + ".js").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>import("./locales/" + localeName + ".js").then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >localeName : Symbol(localeName, Decl(importCallExpressionShouldNotGetParen.ts, 0, 5)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >bar : Symbol(bar, Decl(importCallExpressionShouldNotGetParen.ts, 5, 47)) let x = bar; diff --git a/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.symbols b/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.symbols index adfbd7705ff3a..fbf0705d982ef 100644 --- a/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.symbols +++ b/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.symbols @@ -19,9 +19,9 @@ const p2 = import(whatToLoad ? getSpecifier() : "defaulPath") >getSpecifier : Symbol(getSpecifier, Decl(importCallExpressionSpecifierNotStringTypeError.ts, 0, 0)) p1.then(zero => { ->p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p1.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p1 : Symbol(p1, Decl(importCallExpressionSpecifierNotStringTypeError.ts, 5, 3)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >zero : Symbol(zero, Decl(importCallExpressionSpecifierNotStringTypeError.ts, 7, 8)) return zero.foo(); // ok, zero is any diff --git a/tests/baselines/reference/importCallExpressionWithTypeArgument.symbols b/tests/baselines/reference/importCallExpressionWithTypeArgument.symbols index e8db2d6a7d4cd..48b082da4fbf5 100644 --- a/tests/baselines/reference/importCallExpressionWithTypeArgument.symbols +++ b/tests/baselines/reference/importCallExpressionWithTypeArgument.symbols @@ -6,7 +6,7 @@ export function foo() { return "foo"; } "use strict" var p1 = import>("./0"); // error >p1 : Symbol(p1, Decl(1.ts, 1, 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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0)) var p2 = import<>("./0"); // error diff --git a/tests/baselines/reference/importHelpersES6.symbols b/tests/baselines/reference/importHelpersES6.symbols index 66a8b131aec9a..ef1193275adac 100644 --- a/tests/baselines/reference/importHelpersES6.symbols +++ b/tests/baselines/reference/importHelpersES6.symbols @@ -20,14 +20,14 @@ const y = { ...o }; export declare function __extends(d: Function, b: Function): void; >__extends : Symbol(__extends, Decl(tslib.d.ts, --, --)) >d : Symbol(d, Decl(tslib.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >b : Symbol(b, Decl(tslib.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; >__decorate : Symbol(__decorate, Decl(tslib.d.ts, --, --)) >decorators : Symbol(decorators, Decl(tslib.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >target : Symbol(target, Decl(tslib.d.ts, --, --)) >key : Symbol(key, Decl(tslib.d.ts, --, --)) >desc : Symbol(desc, Decl(tslib.d.ts, --, --)) @@ -36,21 +36,21 @@ export declare function __param(paramIndex: number, decorator: Function): Functi >__param : Symbol(__param, Decl(tslib.d.ts, --, --)) >paramIndex : Symbol(paramIndex, Decl(tslib.d.ts, --, --)) >decorator : Symbol(decorator, Decl(tslib.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) export declare function __metadata(metadataKey: any, metadataValue: any): Function; >__metadata : Symbol(__metadata, Decl(tslib.d.ts, --, --)) >metadataKey : Symbol(metadataKey, Decl(tslib.d.ts, --, --)) >metadataValue : Symbol(metadataValue, Decl(tslib.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any; >__awaiter : Symbol(__awaiter, Decl(tslib.d.ts, --, --)) >thisArg : Symbol(thisArg, Decl(tslib.d.ts, --, --)) >_arguments : Symbol(_arguments, Decl(tslib.d.ts, --, --)) >P : Symbol(P, Decl(tslib.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >generator : Symbol(generator, Decl(tslib.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/incompatibleExports1.symbols b/tests/baselines/reference/incompatibleExports1.symbols index bc69907d2985c..56068d6019bc8 100644 --- a/tests/baselines/reference/incompatibleExports1.symbols +++ b/tests/baselines/reference/incompatibleExports1.symbols @@ -7,7 +7,7 @@ declare module "foo" { interface y { a: Date } >y : Symbol(y, Decl(incompatibleExports1.ts, 1, 36)) >a : Symbol(y.a, Decl(incompatibleExports1.ts, 2, 17)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) export = y; >y : Symbol(y, Decl(incompatibleExports1.ts, 1, 36)) diff --git a/tests/baselines/reference/incompatibleExports2.symbols b/tests/baselines/reference/incompatibleExports2.symbols index bedba8db191e5..c7d84cffd0edd 100644 --- a/tests/baselines/reference/incompatibleExports2.symbols +++ b/tests/baselines/reference/incompatibleExports2.symbols @@ -7,7 +7,7 @@ declare module "foo" { interface y { a: Date } >y : Symbol(y, Decl(incompatibleExports2.ts, 1, 36)) >a : Symbol(y.a, Decl(incompatibleExports2.ts, 2, 17)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) export = y; >y : Symbol(y, Decl(incompatibleExports2.ts, 1, 36)) diff --git a/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt b/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt index 02348777190e3..980cf3790ea68 100644 --- a/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt +++ b/tests/baselines/reference/incompleteDottedExpressionAtEOF.errors.txt @@ -1,11 +1,8 @@ -tests/cases/compiler/incompleteDottedExpressionAtEOF.ts(2,10): error TS2304: Cannot find name 'window'. tests/cases/compiler/incompleteDottedExpressionAtEOF.ts(2,17): error TS1003: Identifier expected. -==== tests/cases/compiler/incompleteDottedExpressionAtEOF.ts (2 errors) ==== +==== tests/cases/compiler/incompleteDottedExpressionAtEOF.ts (1 errors) ==== // used to leak __missing into error message var p2 = window. - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. !!! error TS1003: Identifier expected. \ No newline at end of file diff --git a/tests/baselines/reference/incompleteDottedExpressionAtEOF.symbols b/tests/baselines/reference/incompleteDottedExpressionAtEOF.symbols index c75ce38039f2c..cb00bda7ec4a9 100644 --- a/tests/baselines/reference/incompleteDottedExpressionAtEOF.symbols +++ b/tests/baselines/reference/incompleteDottedExpressionAtEOF.symbols @@ -2,4 +2,5 @@ // used to leak __missing into error message var p2 = window. >p2 : Symbol(p2, Decl(incompleteDottedExpressionAtEOF.ts, 1, 3)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/incompleteDottedExpressionAtEOF.types b/tests/baselines/reference/incompleteDottedExpressionAtEOF.types index d20074c0e358c..c5daa21498d7b 100644 --- a/tests/baselines/reference/incompleteDottedExpressionAtEOF.types +++ b/tests/baselines/reference/incompleteDottedExpressionAtEOF.types @@ -3,6 +3,6 @@ var p2 = window. >p2 : any >window. : any ->window : any +>window : Window > : any diff --git a/tests/baselines/reference/incrementAndDecrement.errors.txt b/tests/baselines/reference/incrementAndDecrement.errors.txt index d41764176a45f..76e96d7187bff 100644 --- a/tests/baselines/reference/incrementAndDecrement.errors.txt +++ b/tests/baselines/reference/incrementAndDecrement.errors.txt @@ -1,4 +1,3 @@ -tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(5,9): error TS2304: Cannot find name 'window'. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(8,5): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(11,5): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(14,5): error TS1005: ';' expected. @@ -27,24 +26,30 @@ tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(46,4): er tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(46,6): error TS1109: Expression expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(47,4): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(47,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(51,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(52,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(53,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(54,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(55,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(55,4): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(55,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(56,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(56,4): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(56,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(57,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(57,4): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(57,6): error TS1109: Expression expected. +tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,3): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,4): error TS1005: ';' expected. tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,6): error TS1109: Expression expected. -==== tests/cases/conformance/expressions/operators/incrementAndDecrement.ts (37 errors) ==== +==== tests/cases/conformance/expressions/operators/incrementAndDecrement.ts (44 errors) ==== enum E { A, B, C }; var x = 4; var e = E.B; var a: any; var w = window; - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. // Assign to expression++ x++ = 4; // Error @@ -147,25 +152,41 @@ tests/cases/conformance/expressions/operators/incrementAndDecrement.ts(58,6): er // Pre and postfix++ on other types w++; // Error + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. w--; // Error + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++w; // Error + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. --w; // Error + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ++w++; // Error + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~ !!! error TS1005: ';' expected. ~ !!! error TS1109: Expression expected. --w--; // Error + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~ !!! error TS1005: ';' expected. ~ !!! error TS1109: Expression expected. ++w--; // Error + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~ !!! error TS1005: ';' expected. ~ !!! error TS1109: Expression expected. --w++; // Error + ~ +!!! error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. ~~ !!! error TS1005: ';' expected. ~ diff --git a/tests/baselines/reference/incrementAndDecrement.symbols b/tests/baselines/reference/incrementAndDecrement.symbols index 45a0a19fcbae9..2990997d64151 100644 --- a/tests/baselines/reference/incrementAndDecrement.symbols +++ b/tests/baselines/reference/incrementAndDecrement.symbols @@ -19,6 +19,7 @@ var a: any; var w = window; >w : Symbol(w, Decl(incrementAndDecrement.ts, 4, 3)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) // Assign to expression++ x++ = 4; // Error diff --git a/tests/baselines/reference/incrementAndDecrement.types b/tests/baselines/reference/incrementAndDecrement.types index 582ed58bc3c81..3ec3e36c3f33d 100644 --- a/tests/baselines/reference/incrementAndDecrement.types +++ b/tests/baselines/reference/incrementAndDecrement.types @@ -19,8 +19,8 @@ var a: any; >a : any var w = window; ->w : any ->window : any +>w : Window +>window : Window // Assign to expression++ x++ = 4; // Error @@ -173,41 +173,41 @@ a--; // Pre and postfix++ on other types w++; // Error >w++ : number ->w : any +>w : Window w--; // Error >w-- : number ->w : any +>w : Window ++w; // Error >++w : number ->w : any +>w : Window --w; // Error >--w : number ->w : any +>w : Window ++w++; // Error >++w : number ->w : any +>w : Window >++ : number > : any --w--; // Error >--w : number ->w : any +>w : Window >-- : number > : any ++w--; // Error >++w : number ->w : any +>w : Window >-- : number > : any --w++; // Error >--w : number ->w : any +>w : Window >++ : number > : any diff --git a/tests/baselines/reference/indexer3.symbols b/tests/baselines/reference/indexer3.symbols index 03b055b343f78..071a160b067fc 100644 --- a/tests/baselines/reference/indexer3.symbols +++ b/tests/baselines/reference/indexer3.symbols @@ -2,10 +2,10 @@ var dateMap: { [x: string]: Date; } = {} >dateMap : Symbol(dateMap, Decl(indexer3.ts, 0, 3)) >x : Symbol(x, Decl(indexer3.ts, 0, 16)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r: Date = dateMap["hello"] // result type includes indexer using BCT >r : Symbol(r, Decl(indexer3.ts, 1, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >dateMap : Symbol(dateMap, Decl(indexer3.ts, 0, 3)) diff --git a/tests/baselines/reference/indexersInClassType.symbols b/tests/baselines/reference/indexersInClassType.symbols index c57c7cf752207..8e0d382dde7e6 100644 --- a/tests/baselines/reference/indexersInClassType.symbols +++ b/tests/baselines/reference/indexersInClassType.symbols @@ -4,14 +4,14 @@ class C { [x: number]: Date; >x : Symbol(x, Decl(indexersInClassType.ts, 1, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) [x: string]: Object; >x : Symbol(x, Decl(indexersInClassType.ts, 2, 5)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) 1: Date; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) 'a': {} diff --git a/tests/baselines/reference/inferenceLimit.symbols b/tests/baselines/reference/inferenceLimit.symbols index 1ae8ca5f1df6c..c11227b29bbd4 100644 --- a/tests/baselines/reference/inferenceLimit.symbols +++ b/tests/baselines/reference/inferenceLimit.symbols @@ -14,8 +14,8 @@ export class BrokenClass { >value : Symbol(value, Decl(file1.ts, 7, 36)) return new Promise>((resolve, reject) => { ->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, --, --)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >MyModule : Symbol(MyModule, Decl(file1.ts, 1, 6)) >MyModel : Symbol(MyModule.MyModel, Decl(mymodule.ts, 0, 0)) >resolve : Symbol(resolve, Decl(file1.ts, 8, 47)) @@ -23,7 +23,7 @@ export class BrokenClass { let result: Array = []; >result : Symbol(result, Decl(file1.ts, 10, 7)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >MyModule : Symbol(MyModule, Decl(file1.ts, 1, 6)) >MyModel : Symbol(MyModule.MyModel, Decl(mymodule.ts, 0, 0)) @@ -32,19 +32,19 @@ export class BrokenClass { >order : Symbol(order, Decl(file1.ts, 12, 25)) return new Promise((resolve, reject) => { ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >resolve : Symbol(resolve, Decl(file1.ts, 13, 26)) >reject : Symbol(reject, Decl(file1.ts, 13, 34)) this.doStuff(order.id) ->this.doStuff(order.id) .then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>this.doStuff(order.id) .then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >this.doStuff : Symbol(BrokenClass.doStuff, Decl(file1.ts, 27, 3)) >this : Symbol(BrokenClass, Decl(file1.ts, 1, 39)) >doStuff : Symbol(BrokenClass.doStuff, Decl(file1.ts, 27, 3)) >order : Symbol(order, Decl(file1.ts, 12, 25)) .then((items) => { ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >items : Symbol(items, Decl(file1.ts, 15, 17)) order.items = items; @@ -60,19 +60,19 @@ export class BrokenClass { }; return Promise.all(result.map(populateItems)) ->Promise.all(result.map(populateItems)) .then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) ->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, --, --)) ->all : Symbol(PromiseConstructor.all, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --) ... and 6 more) ->result.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>Promise.all(result.map(populateItems)) .then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.all : Symbol(PromiseConstructor.all, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 6 more) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>all : Symbol(PromiseConstructor.all, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 6 more) +>result.map : Symbol(Array.map, Decl(lib.es6.d.ts, --, --)) >result : Symbol(result, Decl(file1.ts, 10, 7)) ->map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es6.d.ts, --, --)) >populateItems : Symbol(populateItems, Decl(file1.ts, 12, 7)) .then((orders: Array) => { ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >orders : Symbol(orders, Decl(file1.ts, 23, 13)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >MyModule : Symbol(MyModule, Decl(file1.ts, 1, 6)) >MyModel : Symbol(MyModule.MyModel, Decl(mymodule.ts, 0, 0)) diff --git a/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt b/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt deleted file mode 100644 index 3f79b63ca1eff..0000000000000 --- a/tests/baselines/reference/infinitelyExpandingTypes2.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -tests/cases/compiler/infinitelyExpandingTypes2.ts(10,5): error TS2304: Cannot find name 'console'. - - -==== tests/cases/compiler/infinitelyExpandingTypes2.ts (1 errors) ==== - interface Foo { - x: Foo>; - } - - interface Bar extends Foo { - y: string; - } - - function f(p: Foo) { - console.log(p); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - } - - var v: Bar = null; - - f(v); // should not error - \ No newline at end of file diff --git a/tests/baselines/reference/infinitelyExpandingTypes2.symbols b/tests/baselines/reference/infinitelyExpandingTypes2.symbols index 7f7554fb5fc7e..02fbf72221d01 100644 --- a/tests/baselines/reference/infinitelyExpandingTypes2.symbols +++ b/tests/baselines/reference/infinitelyExpandingTypes2.symbols @@ -26,6 +26,9 @@ function f(p: Foo) { >Foo : Symbol(Foo, Decl(infinitelyExpandingTypes2.ts, 0, 0)) console.log(p); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >p : Symbol(p, Decl(infinitelyExpandingTypes2.ts, 8, 11)) } diff --git a/tests/baselines/reference/infinitelyExpandingTypes2.types b/tests/baselines/reference/infinitelyExpandingTypes2.types index 9dd5652c6521b..cac102429881f 100644 --- a/tests/baselines/reference/infinitelyExpandingTypes2.types +++ b/tests/baselines/reference/infinitelyExpandingTypes2.types @@ -26,10 +26,10 @@ function f(p: Foo) { >Foo : Foo console.log(p); ->console.log(p) : any ->console.log : any ->console : any ->log : any +>console.log(p) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >p : Foo } diff --git a/tests/baselines/reference/infinitelyExpandingTypes5.symbols b/tests/baselines/reference/infinitelyExpandingTypes5.symbols index 32283da9c5d92..b990fad0245cb 100644 --- a/tests/baselines/reference/infinitelyExpandingTypes5.symbols +++ b/tests/baselines/reference/infinitelyExpandingTypes5.symbols @@ -12,13 +12,13 @@ interface Query { } interface Enumerator { ->Enumerator : Symbol(Enumerator, Decl(infinitelyExpandingTypes5.ts, 2, 1)) ->T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 4, 21)) +>Enumerator : Symbol(Enumerator, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(infinitelyExpandingTypes5.ts, 2, 1)) +>T : Symbol(T, Decl(lib.d.ts, --, --), Decl(infinitelyExpandingTypes5.ts, 4, 21)) (action: (item: T, index: number) => boolean): boolean; >action : Symbol(action, Decl(infinitelyExpandingTypes5.ts, 5, 5)) >item : Symbol(item, Decl(infinitelyExpandingTypes5.ts, 5, 14)) ->T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 4, 21)) +>T : Symbol(T, Decl(lib.d.ts, --, --), Decl(infinitelyExpandingTypes5.ts, 4, 21)) >index : Symbol(index, Decl(infinitelyExpandingTypes5.ts, 5, 22)) } @@ -34,7 +34,7 @@ function from(enumerator: Enumerator): Query; >from : Symbol(from, Decl(infinitelyExpandingTypes5.ts, 6, 1), Decl(infinitelyExpandingTypes5.ts, 8, 39), Decl(infinitelyExpandingTypes5.ts, 9, 54)) >T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) >enumerator : Symbol(enumerator, Decl(infinitelyExpandingTypes5.ts, 9, 17)) ->Enumerator : Symbol(Enumerator, Decl(infinitelyExpandingTypes5.ts, 2, 1)) +>Enumerator : Symbol(Enumerator, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(infinitelyExpandingTypes5.ts, 2, 1)) >T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) >Query : Symbol(Query, Decl(infinitelyExpandingTypes5.ts, 0, 0)) >T : Symbol(T, Decl(infinitelyExpandingTypes5.ts, 9, 14)) diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols index dad2ac6f886af..0e83ce75be91a 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.symbols @@ -12,7 +12,7 @@ class B extends A {} var a = new A(); >a : Symbol(a, Decl(inheritanceOfGenericConstructorMethod1.ts, 2, 3)) >A : Symbol(A, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var b1 = new B(); // no error >b1 : Symbol(b1, Decl(inheritanceOfGenericConstructorMethod1.ts, 3, 3)) @@ -21,12 +21,12 @@ var b1 = new B(); // no error var b2: B = new B(); // no error >b2 : Symbol(b2, Decl(inheritanceOfGenericConstructorMethod1.ts, 4, 3)) >B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var b3 = new B(); // error, could not select overload for 'new' expression >b3 : Symbol(b3, Decl(inheritanceOfGenericConstructorMethod1.ts, 5, 3)) >B : Symbol(B, Decl(inheritanceOfGenericConstructorMethod1.ts, 0, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/inheritedGenericCallSignature.symbols b/tests/baselines/reference/inheritedGenericCallSignature.symbols index 715393e6a31fc..63e2c45cd068e 100644 --- a/tests/baselines/reference/inheritedGenericCallSignature.symbols +++ b/tests/baselines/reference/inheritedGenericCallSignature.symbols @@ -33,7 +33,7 @@ interface I2 extends I1 { var x: I2; >x : Symbol(x, Decl(inheritedGenericCallSignature.ts, 19, 3)) >I2 : Symbol(I2, Decl(inheritedGenericCallSignature.ts, 7, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/inlineSourceMap.errors.txt b/tests/baselines/reference/inlineSourceMap.errors.txt deleted file mode 100644 index 69ea738f6bd5b..0000000000000 --- a/tests/baselines/reference/inlineSourceMap.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/compiler/inlineSourceMap.ts(2,1): error TS2304: Cannot find name 'console'. - - -==== tests/cases/compiler/inlineSourceMap.ts (1 errors) ==== - var x = 0; - console.log(x); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/inlineSourceMap.symbols b/tests/baselines/reference/inlineSourceMap.symbols index 63f8111fea5c8..5b47c58018143 100644 --- a/tests/baselines/reference/inlineSourceMap.symbols +++ b/tests/baselines/reference/inlineSourceMap.symbols @@ -3,5 +3,8 @@ var x = 0; >x : Symbol(x, Decl(inlineSourceMap.ts, 0, 3)) console.log(x); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(inlineSourceMap.ts, 0, 3)) diff --git a/tests/baselines/reference/inlineSourceMap.types b/tests/baselines/reference/inlineSourceMap.types index f6d478edf7712..4194704936dee 100644 --- a/tests/baselines/reference/inlineSourceMap.types +++ b/tests/baselines/reference/inlineSourceMap.types @@ -4,9 +4,9 @@ var x = 0; >0 : 0 console.log(x); ->console.log(x) : any ->console.log : any ->console : any ->log : any +>console.log(x) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >x : number diff --git a/tests/baselines/reference/inlineSourceMap2.errors.txt b/tests/baselines/reference/inlineSourceMap2.errors.txt index ee60b349348c3..b9c1ab03e2d11 100644 --- a/tests/baselines/reference/inlineSourceMap2.errors.txt +++ b/tests/baselines/reference/inlineSourceMap2.errors.txt @@ -1,14 +1,11 @@ error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. -tests/cases/compiler/inlineSourceMap2.ts(4,1): error TS2304: Cannot find name 'console'. !!! error TS5053: Option 'mapRoot' cannot be specified with option 'inlineSourceMap'. !!! error TS5053: Option 'sourceMap' cannot be specified with option 'inlineSourceMap'. -==== tests/cases/compiler/inlineSourceMap2.ts (1 errors) ==== +==== tests/cases/compiler/inlineSourceMap2.ts (0 errors) ==== // configuration errors var x = 0; - console.log(x); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. \ No newline at end of file + console.log(x); \ No newline at end of file diff --git a/tests/baselines/reference/inlineSourceMap2.symbols b/tests/baselines/reference/inlineSourceMap2.symbols index e1a4b77574de0..3660b68bbe966 100644 --- a/tests/baselines/reference/inlineSourceMap2.symbols +++ b/tests/baselines/reference/inlineSourceMap2.symbols @@ -5,5 +5,8 @@ var x = 0; >x : Symbol(x, Decl(inlineSourceMap2.ts, 2, 3)) console.log(x); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(inlineSourceMap2.ts, 2, 3)) diff --git a/tests/baselines/reference/inlineSourceMap2.types b/tests/baselines/reference/inlineSourceMap2.types index 1593c4ee43286..9a3a1f57af60e 100644 --- a/tests/baselines/reference/inlineSourceMap2.types +++ b/tests/baselines/reference/inlineSourceMap2.types @@ -6,9 +6,9 @@ var x = 0; >0 : 0 console.log(x); ->console.log(x) : any ->console.log : any ->console : any ->log : any +>console.log(x) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >x : number diff --git a/tests/baselines/reference/inlineSources.errors.txt b/tests/baselines/reference/inlineSources.errors.txt deleted file mode 100644 index ff72c35b867f2..0000000000000 --- a/tests/baselines/reference/inlineSources.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -tests/cases/compiler/a.ts(2,1): error TS2304: Cannot find name 'console'. -tests/cases/compiler/b.ts(2,1): error TS2304: Cannot find name 'console'. - - -==== tests/cases/compiler/a.ts (1 errors) ==== - var a = 0; - console.log(a); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - -==== tests/cases/compiler/b.ts (1 errors) ==== - var b = 0; - console.log(b); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources.symbols b/tests/baselines/reference/inlineSources.symbols index ce2fce1e76220..0da73fed123a5 100644 --- a/tests/baselines/reference/inlineSources.symbols +++ b/tests/baselines/reference/inlineSources.symbols @@ -3,6 +3,9 @@ var a = 0; >a : Symbol(a, Decl(a.ts, 0, 3)) console.log(a); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(a.ts, 0, 3)) === tests/cases/compiler/b.ts === @@ -10,5 +13,8 @@ var b = 0; >b : Symbol(b, Decl(b.ts, 0, 3)) console.log(b); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(b.ts, 0, 3)) diff --git a/tests/baselines/reference/inlineSources.types b/tests/baselines/reference/inlineSources.types index 5cb35846a46ea..8654347fbafbf 100644 --- a/tests/baselines/reference/inlineSources.types +++ b/tests/baselines/reference/inlineSources.types @@ -4,10 +4,10 @@ var a = 0; >0 : 0 console.log(a); ->console.log(a) : any ->console.log : any ->console : any ->log : any +>console.log(a) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >a : number === tests/cases/compiler/b.ts === @@ -16,9 +16,9 @@ var b = 0; >0 : 0 console.log(b); ->console.log(b) : any ->console.log : any ->console : any ->log : any +>console.log(b) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >b : number diff --git a/tests/baselines/reference/inlineSources2.errors.txt b/tests/baselines/reference/inlineSources2.errors.txt deleted file mode 100644 index ff72c35b867f2..0000000000000 --- a/tests/baselines/reference/inlineSources2.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -tests/cases/compiler/a.ts(2,1): error TS2304: Cannot find name 'console'. -tests/cases/compiler/b.ts(2,1): error TS2304: Cannot find name 'console'. - - -==== tests/cases/compiler/a.ts (1 errors) ==== - var a = 0; - console.log(a); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - -==== tests/cases/compiler/b.ts (1 errors) ==== - var b = 0; - console.log(b); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/inlineSources2.symbols b/tests/baselines/reference/inlineSources2.symbols index ce2fce1e76220..0da73fed123a5 100644 --- a/tests/baselines/reference/inlineSources2.symbols +++ b/tests/baselines/reference/inlineSources2.symbols @@ -3,6 +3,9 @@ var a = 0; >a : Symbol(a, Decl(a.ts, 0, 3)) console.log(a); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(a.ts, 0, 3)) === tests/cases/compiler/b.ts === @@ -10,5 +13,8 @@ var b = 0; >b : Symbol(b, Decl(b.ts, 0, 3)) console.log(b); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(b.ts, 0, 3)) diff --git a/tests/baselines/reference/inlineSources2.types b/tests/baselines/reference/inlineSources2.types index 5cb35846a46ea..8654347fbafbf 100644 --- a/tests/baselines/reference/inlineSources2.types +++ b/tests/baselines/reference/inlineSources2.types @@ -4,10 +4,10 @@ var a = 0; >0 : 0 console.log(a); ->console.log(a) : any ->console.log : any ->console : any ->log : any +>console.log(a) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >a : number === tests/cases/compiler/b.ts === @@ -16,9 +16,9 @@ var b = 0; >0 : 0 console.log(b); ->console.log(b) : any ->console.log : any ->console : any ->log : any +>console.log(b) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >b : number diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols index d3488b4db72c9..106f40ef3a915 100644 --- a/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne.symbols @@ -5,7 +5,7 @@ function f() { >f : Symbol(f, Decl(innerTypeParameterShadowingOuterOne.ts, 0, 0)) >T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 3, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function g() { >g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne.ts, 3, 30)) @@ -34,9 +34,9 @@ function f() { function f2() { >f2 : Symbol(f2, Decl(innerTypeParameterShadowingOuterOne.ts, 10, 1)) >T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 27)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function g() { >g : Symbol(g, Decl(innerTypeParameterShadowingOuterOne.ts, 12, 47)) diff --git a/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols index 1a54ab4024a79..d262182c029b1 100644 --- a/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols +++ b/tests/baselines/reference/innerTypeParameterShadowingOuterOne2.symbols @@ -5,7 +5,7 @@ class C { >C : Symbol(C, Decl(innerTypeParameterShadowingOuterOne2.ts, 0, 0)) >T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 3, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) g() { >g : Symbol(C.g, Decl(innerTypeParameterShadowingOuterOne2.ts, 3, 25)) @@ -39,9 +39,9 @@ class C { class C2 { >C2 : Symbol(C2, Decl(innerTypeParameterShadowingOuterOne2.ts, 13, 1)) >T : Symbol(T, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 24)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) g() { >g : Symbol(C2.g, Decl(innerTypeParameterShadowingOuterOne2.ts, 15, 42)) diff --git a/tests/baselines/reference/intersectionTypeInference3.symbols b/tests/baselines/reference/intersectionTypeInference3.symbols index 3945cf64fb6ea..dacf0e6d546bc 100644 --- a/tests/baselines/reference/intersectionTypeInference3.symbols +++ b/tests/baselines/reference/intersectionTypeInference3.symbols @@ -8,9 +8,9 @@ type Nominal = Type & { >Type : Symbol(Type, Decl(intersectionTypeInference3.ts, 2, 33)) [Symbol.species]: Kind; ->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, --, --)) +>Symbol.species : Symbol(SymbolConstructor.species, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>species : Symbol(SymbolConstructor.species, Decl(lib.es6.d.ts, --, --)) >Kind : Symbol(Kind, Decl(intersectionTypeInference3.ts, 2, 13)) }; @@ -21,25 +21,25 @@ type A = Nominal<'A', string>; declare const a: Set; >a : Symbol(a, Decl(intersectionTypeInference3.ts, 8, 13)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >A : Symbol(A, Decl(intersectionTypeInference3.ts, 4, 2)) declare const b: Set; >b : Symbol(b, Decl(intersectionTypeInference3.ts, 9, 13)) ->Set : Symbol(Set, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Set : Symbol(Set, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >A : Symbol(A, Decl(intersectionTypeInference3.ts, 4, 2)) const c1 = Array.from(a).concat(Array.from(b)); >c1 : Symbol(c1, Decl(intersectionTypeInference3.ts, 11, 5)) ->Array.from(a).concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Array.from(a).concat : Symbol(Array.concat, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(intersectionTypeInference3.ts, 8, 13)) ->concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->Array.from : Symbol(ArrayConstructor.from, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->from : Symbol(ArrayConstructor.from, Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Array.from : Symbol(ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >b : Symbol(b, Decl(intersectionTypeInference3.ts, 9, 13)) // Simpler repro @@ -51,7 +51,7 @@ declare function from(): T[]; const c2: ReadonlyArray = from(); >c2 : Symbol(c2, Decl(intersectionTypeInference3.ts, 16, 5)) ->ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >A : Symbol(A, Decl(intersectionTypeInference3.ts, 4, 2)) >from : Symbol(from, Decl(intersectionTypeInference3.ts, 11, 47)) diff --git a/tests/baselines/reference/intersectionTypeInference3.types b/tests/baselines/reference/intersectionTypeInference3.types index 9fca37af8c197..0e1816ded1447 100644 --- a/tests/baselines/reference/intersectionTypeInference3.types +++ b/tests/baselines/reference/intersectionTypeInference3.types @@ -34,15 +34,15 @@ const c1 = Array.from(a).concat(Array.from(b)); >Array.from(a).concat(Array.from(b)) : Nominal<"A", string>[] >Array.from(a).concat : { (...items: ReadonlyArray>[]): Nominal<"A", string>[]; (...items: (Nominal<"A", string> | ReadonlyArray>)[]): Nominal<"A", string>[]; } >Array.from(a) : Nominal<"A", string>[] ->Array.from : { (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >a : Set> >concat : { (...items: ReadonlyArray>[]): Nominal<"A", string>[]; (...items: (Nominal<"A", string> | ReadonlyArray>)[]): Nominal<"A", string>[]; } >Array.from(b) : Nominal<"A", string>[] ->Array.from : { (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>Array.from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >Array : ArrayConstructor ->from : { (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } +>from : { (arrayLike: ArrayLike): T[]; (arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; (iterable: Iterable): T[]; (iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; } >b : Set> // Simpler repro diff --git a/tests/baselines/reference/invalidReturnStatements.symbols b/tests/baselines/reference/invalidReturnStatements.symbols index 138e434329131..1d7a7cd3ec569 100644 --- a/tests/baselines/reference/invalidReturnStatements.symbols +++ b/tests/baselines/reference/invalidReturnStatements.symbols @@ -11,7 +11,7 @@ function fn3(): boolean { } function fn4(): Date { } >fn4 : Symbol(fn4, Decl(invalidReturnStatements.ts, 3, 27)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function fn7(): any { } // should be valid: any includes void >fn7 : Symbol(fn7, Decl(invalidReturnStatements.ts, 4, 25)) diff --git a/tests/baselines/reference/iterableArrayPattern1.symbols b/tests/baselines/reference/iterableArrayPattern1.symbols index b901b43b7b90b..12d0d36d4cc0f 100644 --- a/tests/baselines/reference/iterableArrayPattern1.symbols +++ b/tests/baselines/reference/iterableArrayPattern1.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iterableArrayPattern1.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iterableArrayPattern1.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 0)) diff --git a/tests/baselines/reference/iterableArrayPattern10.symbols b/tests/baselines/reference/iterableArrayPattern10.symbols index 12f5c1b3cb76b..2519fdf0837c4 100644 --- a/tests/baselines/reference/iterableArrayPattern10.symbols +++ b/tests/baselines/reference/iterableArrayPattern10.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern10.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern11.symbols b/tests/baselines/reference/iterableArrayPattern11.symbols index 36871283fbfd0..dd204d6d2616a 100644 --- a/tests/baselines/reference/iterableArrayPattern11.symbols +++ b/tests/baselines/reference/iterableArrayPattern11.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern12.symbols b/tests/baselines/reference/iterableArrayPattern12.symbols index cb876370876a2..105d9236f25cb 100644 --- a/tests/baselines/reference/iterableArrayPattern12.symbols +++ b/tests/baselines/reference/iterableArrayPattern12.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern13.symbols b/tests/baselines/reference/iterableArrayPattern13.symbols index 25241ab24b880..563bc7d114538 100644 --- a/tests/baselines/reference/iterableArrayPattern13.symbols +++ b/tests/baselines/reference/iterableArrayPattern13.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern14.symbols b/tests/baselines/reference/iterableArrayPattern14.symbols index 7479c8f085764..4ae0ce6b7466d 100644 --- a/tests/baselines/reference/iterableArrayPattern14.symbols +++ b/tests/baselines/reference/iterableArrayPattern14.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern14.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern15.symbols b/tests/baselines/reference/iterableArrayPattern15.symbols index 98a1c9e5c5d1c..b1b5ab0cbe9f7 100644 --- a/tests/baselines/reference/iterableArrayPattern15.symbols +++ b/tests/baselines/reference/iterableArrayPattern15.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern15.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern16.symbols b/tests/baselines/reference/iterableArrayPattern16.symbols index 59b8ee70562e6..ee1381b125ffd 100644 --- a/tests/baselines/reference/iterableArrayPattern16.symbols +++ b/tests/baselines/reference/iterableArrayPattern16.symbols @@ -37,9 +37,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern16.ts, 3, 27)) @@ -64,9 +64,9 @@ class FooIteratorIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIteratorIterator, Decl(iterableArrayPattern16.ts, 15, 1)) diff --git a/tests/baselines/reference/iterableArrayPattern17.symbols b/tests/baselines/reference/iterableArrayPattern17.symbols index 1312aded6a129..668339c8581a6 100644 --- a/tests/baselines/reference/iterableArrayPattern17.symbols +++ b/tests/baselines/reference/iterableArrayPattern17.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern17.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern18.symbols b/tests/baselines/reference/iterableArrayPattern18.symbols index c928f068c65ed..aa66773a5e72b 100644 --- a/tests/baselines/reference/iterableArrayPattern18.symbols +++ b/tests/baselines/reference/iterableArrayPattern18.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern18.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern19.symbols b/tests/baselines/reference/iterableArrayPattern19.symbols index 9d5caeb43d563..a1218e9478c4f 100644 --- a/tests/baselines/reference/iterableArrayPattern19.symbols +++ b/tests/baselines/reference/iterableArrayPattern19.symbols @@ -26,9 +26,9 @@ class FooArrayIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooArrayIterator, Decl(iterableArrayPattern19.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern2.symbols b/tests/baselines/reference/iterableArrayPattern2.symbols index db700cdd57254..f9aa29a931980 100644 --- a/tests/baselines/reference/iterableArrayPattern2.symbols +++ b/tests/baselines/reference/iterableArrayPattern2.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iterableArrayPattern2.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iterableArrayPattern2.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 0)) diff --git a/tests/baselines/reference/iterableArrayPattern20.symbols b/tests/baselines/reference/iterableArrayPattern20.symbols index 6649bf547cf06..41e09a69eec81 100644 --- a/tests/baselines/reference/iterableArrayPattern20.symbols +++ b/tests/baselines/reference/iterableArrayPattern20.symbols @@ -26,9 +26,9 @@ class FooArrayIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooArrayIterator, Decl(iterableArrayPattern20.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern25.symbols b/tests/baselines/reference/iterableArrayPattern25.symbols index 1450f8539cf0c..a0a84b0898cba 100644 --- a/tests/baselines/reference/iterableArrayPattern25.symbols +++ b/tests/baselines/reference/iterableArrayPattern25.symbols @@ -8,5 +8,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); >takeFirstTwoEntries : Symbol(takeFirstTwoEntries, Decl(iterableArrayPattern25.ts, 0, 0)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern26.symbols b/tests/baselines/reference/iterableArrayPattern26.symbols index f67e7b861d2b7..cac9d55522e41 100644 --- a/tests/baselines/reference/iterableArrayPattern26.symbols +++ b/tests/baselines/reference/iterableArrayPattern26.symbols @@ -8,5 +8,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(new Map([["", 0], ["hello", 1]])); >takeFirstTwoEntries : Symbol(takeFirstTwoEntries, Decl(iterableArrayPattern26.ts, 0, 0)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern27.symbols b/tests/baselines/reference/iterableArrayPattern27.symbols index 58e34b3595484..ec46e3ba8dc25 100644 --- a/tests/baselines/reference/iterableArrayPattern27.symbols +++ b/tests/baselines/reference/iterableArrayPattern27.symbols @@ -8,5 +8,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", 1]])); >takeFirstTwoEntries : Symbol(takeFirstTwoEntries, Decl(iterableArrayPattern27.ts, 0, 0)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern29.symbols b/tests/baselines/reference/iterableArrayPattern29.symbols index 690685b857a6d..aca17d23757b6 100644 --- a/tests/baselines/reference/iterableArrayPattern29.symbols +++ b/tests/baselines/reference/iterableArrayPattern29.symbols @@ -8,5 +8,5 @@ function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", true], ["hello", true]])); >takeFirstTwoEntries : Symbol(takeFirstTwoEntries, Decl(iterableArrayPattern29.ts, 0, 0)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern3.symbols b/tests/baselines/reference/iterableArrayPattern3.symbols index a82c5f5e0256c..9a67ae2b30b58 100644 --- a/tests/baselines/reference/iterableArrayPattern3.symbols +++ b/tests/baselines/reference/iterableArrayPattern3.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern30.symbols b/tests/baselines/reference/iterableArrayPattern30.symbols index b659792249048..1d0ccdee79138 100644 --- a/tests/baselines/reference/iterableArrayPattern30.symbols +++ b/tests/baselines/reference/iterableArrayPattern30.symbols @@ -4,5 +4,5 @@ const [[k1, v1], [k2, v2]] = new Map([["", true], ["hello", true]]) >v1 : Symbol(v1, Decl(iterableArrayPattern30.ts, 0, 11)) >k2 : Symbol(k2, Decl(iterableArrayPattern30.ts, 0, 18)) >v2 : Symbol(v2, Decl(iterableArrayPattern30.ts, 0, 21)) ->Map : Symbol(Map, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --), Decl(lib.es2015.collection.d.ts, --, --)) +>Map : Symbol(Map, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/iterableArrayPattern4.symbols b/tests/baselines/reference/iterableArrayPattern4.symbols index 6a3526a3482d7..06061b341e2bd 100644 --- a/tests/baselines/reference/iterableArrayPattern4.symbols +++ b/tests/baselines/reference/iterableArrayPattern4.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern5.symbols b/tests/baselines/reference/iterableArrayPattern5.symbols index edfcbce076de0..2c6681b24a412 100644 --- a/tests/baselines/reference/iterableArrayPattern5.symbols +++ b/tests/baselines/reference/iterableArrayPattern5.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern5.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern6.symbols b/tests/baselines/reference/iterableArrayPattern6.symbols index 797f7770b897f..a81a9c050e711 100644 --- a/tests/baselines/reference/iterableArrayPattern6.symbols +++ b/tests/baselines/reference/iterableArrayPattern6.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern6.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern7.symbols b/tests/baselines/reference/iterableArrayPattern7.symbols index 6faf9adcf13f8..5fae7dcd262cc 100644 --- a/tests/baselines/reference/iterableArrayPattern7.symbols +++ b/tests/baselines/reference/iterableArrayPattern7.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern7.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern8.symbols b/tests/baselines/reference/iterableArrayPattern8.symbols index 035b391d38b5e..c7ff7bd52218a 100644 --- a/tests/baselines/reference/iterableArrayPattern8.symbols +++ b/tests/baselines/reference/iterableArrayPattern8.symbols @@ -26,9 +26,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern8.ts, 1, 27)) diff --git a/tests/baselines/reference/iterableArrayPattern9.symbols b/tests/baselines/reference/iterableArrayPattern9.symbols index d85329c45078b..9eed20bfbdaf8 100644 --- a/tests/baselines/reference/iterableArrayPattern9.symbols +++ b/tests/baselines/reference/iterableArrayPattern9.symbols @@ -32,9 +32,9 @@ class FooIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(FooIterator, Decl(iterableArrayPattern9.ts, 2, 27)) diff --git a/tests/baselines/reference/iterableContextualTyping1.symbols b/tests/baselines/reference/iterableContextualTyping1.symbols index 7a7f77e789817..29e3a5b207093 100644 --- a/tests/baselines/reference/iterableContextualTyping1.symbols +++ b/tests/baselines/reference/iterableContextualTyping1.symbols @@ -1,10 +1,10 @@ === tests/cases/conformance/expressions/contextualTyping/iterableContextualTyping1.ts === var iter: Iterable<(x: string) => number> = [s => s.length]; >iter : Symbol(iter, Decl(iterableContextualTyping1.ts, 0, 3)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(iterableContextualTyping1.ts, 0, 20)) >s : Symbol(s, Decl(iterableContextualTyping1.ts, 0, 45)) ->s.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>s.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(iterableContextualTyping1.ts, 0, 45)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/iteratorSpreadInArray.symbols b/tests/baselines/reference/iteratorSpreadInArray.symbols index 6d6656f0f71fc..6afd84fd55617 100644 --- a/tests/baselines/reference/iteratorSpreadInArray.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray.ts, 0, 0)) diff --git a/tests/baselines/reference/iteratorSpreadInArray10.symbols b/tests/baselines/reference/iteratorSpreadInArray10.symbols index f2aa6fab527b2..b6e56f8157e1f 100644 --- a/tests/baselines/reference/iteratorSpreadInArray10.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray10.symbols @@ -3,9 +3,9 @@ class SymbolIterator { >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray10.ts, 0, 0)) [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray10.ts, 0, 0)) diff --git a/tests/baselines/reference/iteratorSpreadInArray11.symbols b/tests/baselines/reference/iteratorSpreadInArray11.symbols index 6194a8305aac5..70d46097c90c9 100644 --- a/tests/baselines/reference/iteratorSpreadInArray11.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray11.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/spread/iteratorSpreadInArray11.ts === var iter: Iterable; >iter : Symbol(iter, Decl(iteratorSpreadInArray11.ts, 0, 3)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) var array = [...iter]; >array : Symbol(array, Decl(iteratorSpreadInArray11.ts, 1, 3)) diff --git a/tests/baselines/reference/iteratorSpreadInArray2.symbols b/tests/baselines/reference/iteratorSpreadInArray2.symbols index 6fd22547ee643..9df3f2683be50 100644 --- a/tests/baselines/reference/iteratorSpreadInArray2.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray2.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray2.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray2.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray2.ts, 0, 0)) @@ -43,9 +43,9 @@ class NumberIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(NumberIterator, Decl(iteratorSpreadInArray2.ts, 11, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInArray3.symbols b/tests/baselines/reference/iteratorSpreadInArray3.symbols index ff6bc66e9d351..62caffc1c293e 100644 --- a/tests/baselines/reference/iteratorSpreadInArray3.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray3.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray3.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray3.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray3.ts, 0, 0)) diff --git a/tests/baselines/reference/iteratorSpreadInArray4.symbols b/tests/baselines/reference/iteratorSpreadInArray4.symbols index 16fa1c62c6c02..827f87a81b823 100644 --- a/tests/baselines/reference/iteratorSpreadInArray4.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray4.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray4.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray4.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray4.ts, 0, 0)) diff --git a/tests/baselines/reference/iteratorSpreadInArray5.symbols b/tests/baselines/reference/iteratorSpreadInArray5.symbols index 36174db94e7a0..aaad4ee499ebf 100644 --- a/tests/baselines/reference/iteratorSpreadInArray5.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray5.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray5.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray5.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray5.ts, 0, 0)) diff --git a/tests/baselines/reference/iteratorSpreadInArray6.symbols b/tests/baselines/reference/iteratorSpreadInArray6.symbols index ab01672156de4..361259f47ea00 100644 --- a/tests/baselines/reference/iteratorSpreadInArray6.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray6.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray6.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray6.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray6.ts, 0, 0)) @@ -30,8 +30,8 @@ var array: number[] = [0, 1]; >array : Symbol(array, Decl(iteratorSpreadInArray6.ts, 13, 3)) array.concat([...new SymbolIterator]); ->array.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>array.concat : Symbol(Array.concat, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >array : Symbol(array, Decl(iteratorSpreadInArray6.ts, 13, 3)) ->concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray6.ts, 0, 0)) diff --git a/tests/baselines/reference/iteratorSpreadInArray7.symbols b/tests/baselines/reference/iteratorSpreadInArray7.symbols index 534741a62a62e..dd206b20e8917 100644 --- a/tests/baselines/reference/iteratorSpreadInArray7.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray7.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray7.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray7.ts, 3, 28)) @@ -17,9 +17,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 0, 0)) @@ -30,8 +30,8 @@ var array: symbol[]; >array : Symbol(array, Decl(iteratorSpreadInArray7.ts, 13, 3)) array.concat([...new SymbolIterator]); ->array.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>array.concat : Symbol(Array.concat, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >array : Symbol(array, Decl(iteratorSpreadInArray7.ts, 13, 3)) ->concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >SymbolIterator : Symbol(SymbolIterator, Decl(iteratorSpreadInArray7.ts, 0, 0)) diff --git a/tests/baselines/reference/iteratorSpreadInArray8.symbols b/tests/baselines/reference/iteratorSpreadInArray8.symbols index 3555c918ac1d3..678ede19e935e 100644 --- a/tests/baselines/reference/iteratorSpreadInArray8.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray8.symbols @@ -8,7 +8,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInArray8.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInArray8.ts, 3, 28)) diff --git a/tests/baselines/reference/iteratorSpreadInArray9.symbols b/tests/baselines/reference/iteratorSpreadInArray9.symbols index a5564e9773d6c..73d4a00fb7fec 100644 --- a/tests/baselines/reference/iteratorSpreadInArray9.symbols +++ b/tests/baselines/reference/iteratorSpreadInArray9.symbols @@ -8,15 +8,15 @@ class SymbolIterator { return { value: Symbol() >value : Symbol(value, Decl(iteratorSpreadInArray9.ts, 2, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) }; } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInArray9.ts, 0, 0)) diff --git a/tests/baselines/reference/iteratorSpreadInCall.symbols b/tests/baselines/reference/iteratorSpreadInCall.symbols index 372fc25e8e69c..bc0258188d7a3 100644 --- a/tests/baselines/reference/iteratorSpreadInCall.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall.symbols @@ -12,7 +12,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall.ts, 4, 28)) @@ -21,9 +21,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall.ts, 0, 27)) diff --git a/tests/baselines/reference/iteratorSpreadInCall10.symbols b/tests/baselines/reference/iteratorSpreadInCall10.symbols index 3ee60f7c58f7b..bc6aeda90f44d 100644 --- a/tests/baselines/reference/iteratorSpreadInCall10.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall10.symbols @@ -15,7 +15,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall10.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall10.ts, 4, 28)) @@ -24,9 +24,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall10.ts, 0, 39)) diff --git a/tests/baselines/reference/iteratorSpreadInCall11.symbols b/tests/baselines/reference/iteratorSpreadInCall11.symbols index b6db07942d0ad..d3dade2a691c4 100644 --- a/tests/baselines/reference/iteratorSpreadInCall11.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall11.symbols @@ -15,7 +15,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall11.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall11.ts, 4, 28)) @@ -24,9 +24,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall11.ts, 0, 42)) diff --git a/tests/baselines/reference/iteratorSpreadInCall12.symbols b/tests/baselines/reference/iteratorSpreadInCall12.symbols index 983ab8fcd909a..59a64e2482443 100644 --- a/tests/baselines/reference/iteratorSpreadInCall12.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall12.symbols @@ -17,7 +17,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall12.ts, 6, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall12.ts, 7, 28)) @@ -26,9 +26,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall12.ts, 2, 1)) @@ -52,9 +52,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(iteratorSpreadInCall12.ts, 15, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall2.symbols b/tests/baselines/reference/iteratorSpreadInCall2.symbols index bf0f71c4fd5a4..4e9cc9f288570 100644 --- a/tests/baselines/reference/iteratorSpreadInCall2.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall2.symbols @@ -12,7 +12,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall2.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall2.ts, 4, 28)) @@ -21,9 +21,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall2.ts, 0, 29)) diff --git a/tests/baselines/reference/iteratorSpreadInCall3.symbols b/tests/baselines/reference/iteratorSpreadInCall3.symbols index d8f414bcd72ee..90198d39e6bdd 100644 --- a/tests/baselines/reference/iteratorSpreadInCall3.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall3.symbols @@ -12,7 +12,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall3.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall3.ts, 4, 28)) @@ -21,9 +21,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall3.ts, 0, 32)) diff --git a/tests/baselines/reference/iteratorSpreadInCall4.symbols b/tests/baselines/reference/iteratorSpreadInCall4.symbols index b811baa008391..0e3fe54ad08ae 100644 --- a/tests/baselines/reference/iteratorSpreadInCall4.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall4.symbols @@ -13,7 +13,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall4.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall4.ts, 4, 28)) @@ -22,9 +22,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall4.ts, 0, 44)) diff --git a/tests/baselines/reference/iteratorSpreadInCall5.symbols b/tests/baselines/reference/iteratorSpreadInCall5.symbols index 81143b79f292b..aae75367c94f2 100644 --- a/tests/baselines/reference/iteratorSpreadInCall5.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall5.symbols @@ -12,7 +12,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall5.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall5.ts, 4, 28)) @@ -21,9 +21,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall5.ts, 0, 43)) @@ -47,9 +47,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(iteratorSpreadInCall5.ts, 12, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall6.symbols b/tests/baselines/reference/iteratorSpreadInCall6.symbols index d41a3fcea460d..6fbea8bcca4ae 100644 --- a/tests/baselines/reference/iteratorSpreadInCall6.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall6.symbols @@ -12,7 +12,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall6.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall6.ts, 4, 28)) @@ -21,9 +21,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall6.ts, 0, 43)) @@ -47,9 +47,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(iteratorSpreadInCall6.ts, 12, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall7.symbols b/tests/baselines/reference/iteratorSpreadInCall7.symbols index a0e62299ae952..d27bf61a3eab7 100644 --- a/tests/baselines/reference/iteratorSpreadInCall7.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall7.symbols @@ -15,7 +15,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall7.ts, 3, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall7.ts, 4, 28)) @@ -24,9 +24,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall7.ts, 0, 43)) @@ -50,9 +50,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(iteratorSpreadInCall7.ts, 12, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall8.symbols b/tests/baselines/reference/iteratorSpreadInCall8.symbols index bd84d77686e5a..a99b348386e2e 100644 --- a/tests/baselines/reference/iteratorSpreadInCall8.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall8.symbols @@ -17,7 +17,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall8.ts, 6, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall8.ts, 7, 28)) @@ -26,9 +26,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall8.ts, 2, 1)) @@ -52,9 +52,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(iteratorSpreadInCall8.ts, 15, 1)) diff --git a/tests/baselines/reference/iteratorSpreadInCall9.symbols b/tests/baselines/reference/iteratorSpreadInCall9.symbols index 70486768d4d5f..d9f1e2a5970dc 100644 --- a/tests/baselines/reference/iteratorSpreadInCall9.symbols +++ b/tests/baselines/reference/iteratorSpreadInCall9.symbols @@ -17,7 +17,7 @@ class SymbolIterator { return { value: Symbol(), >value : Symbol(value, Decl(iteratorSpreadInCall9.ts, 6, 16)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) done: false >done : Symbol(done, Decl(iteratorSpreadInCall9.ts, 7, 28)) @@ -26,9 +26,9 @@ class SymbolIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(SymbolIterator, Decl(iteratorSpreadInCall9.ts, 2, 1)) @@ -52,9 +52,9 @@ class StringIterator { } [Symbol.iterator]() { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) return this; >this : Symbol(StringIterator, Decl(iteratorSpreadInCall9.ts, 15, 1)) diff --git a/tests/baselines/reference/iteratorsAndStrictNullChecks.symbols b/tests/baselines/reference/iteratorsAndStrictNullChecks.symbols index fb75206a82577..0aa0bf641d882 100644 --- a/tests/baselines/reference/iteratorsAndStrictNullChecks.symbols +++ b/tests/baselines/reference/iteratorsAndStrictNullChecks.symbols @@ -4,9 +4,9 @@ for (const x of ["a", "b"]) { >x : Symbol(x, Decl(iteratorsAndStrictNullChecks.ts, 1, 10)) x.substring; ->x.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>x.substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(iteratorsAndStrictNullChecks.ts, 1, 10)) ->substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) } // Spread @@ -17,8 +17,8 @@ const ys = [4, 5]; >ys : Symbol(ys, Decl(iteratorsAndStrictNullChecks.ts, 7, 5)) xs.push(...ys); ->xs.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>xs.push : Symbol(Array.push, Decl(lib.es6.d.ts, --, --)) >xs : Symbol(xs, Decl(iteratorsAndStrictNullChecks.ts, 6, 5)) ->push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es6.d.ts, --, --)) >ys : Symbol(ys, Decl(iteratorsAndStrictNullChecks.ts, 7, 5)) diff --git a/tests/baselines/reference/jsxEmitWithAttributes.symbols b/tests/baselines/reference/jsxEmitWithAttributes.symbols index f20470ebb6b37..88670c2eb0e75 100644 --- a/tests/baselines/reference/jsxEmitWithAttributes.symbols +++ b/tests/baselines/reference/jsxEmitWithAttributes.symbols @@ -68,12 +68,12 @@ function toCamelCase(text: string): string { >text : Symbol(text, Decl(Element.ts, 26, 21)) return text[0].toLowerCase() + text.substring(1); ->text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) +>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) ->text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) +>text.substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) } === tests/cases/compiler/test.tsx === diff --git a/tests/baselines/reference/jsxFactoryAndReactNamespace.symbols b/tests/baselines/reference/jsxFactoryAndReactNamespace.symbols index f20470ebb6b37..88670c2eb0e75 100644 --- a/tests/baselines/reference/jsxFactoryAndReactNamespace.symbols +++ b/tests/baselines/reference/jsxFactoryAndReactNamespace.symbols @@ -68,12 +68,12 @@ function toCamelCase(text: string): string { >text : Symbol(text, Decl(Element.ts, 26, 21)) return text[0].toLowerCase() + text.substring(1); ->text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) +>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) ->text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) +>text.substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) } === tests/cases/compiler/test.tsx === diff --git a/tests/baselines/reference/jsxFactoryIdentifier.symbols b/tests/baselines/reference/jsxFactoryIdentifier.symbols index b66976f8884b4..380a45d2a911a 100644 --- a/tests/baselines/reference/jsxFactoryIdentifier.symbols +++ b/tests/baselines/reference/jsxFactoryIdentifier.symbols @@ -68,12 +68,12 @@ function toCamelCase(text: string): string { >text : Symbol(text, Decl(Element.ts, 26, 21)) return text[0].toLowerCase() + text.substring(1); ->text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) +>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) ->text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) +>text.substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) } === tests/cases/compiler/test.tsx === diff --git a/tests/baselines/reference/jsxFactoryNotIdentifierOrQualifiedName.symbols b/tests/baselines/reference/jsxFactoryNotIdentifierOrQualifiedName.symbols index f20470ebb6b37..88670c2eb0e75 100644 --- a/tests/baselines/reference/jsxFactoryNotIdentifierOrQualifiedName.symbols +++ b/tests/baselines/reference/jsxFactoryNotIdentifierOrQualifiedName.symbols @@ -68,12 +68,12 @@ function toCamelCase(text: string): string { >text : Symbol(text, Decl(Element.ts, 26, 21)) return text[0].toLowerCase() + text.substring(1); ->text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) +>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) ->text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) +>text.substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) } === tests/cases/compiler/test.tsx === diff --git a/tests/baselines/reference/jsxFactoryNotIdentifierOrQualifiedName2.symbols b/tests/baselines/reference/jsxFactoryNotIdentifierOrQualifiedName2.symbols index f20470ebb6b37..88670c2eb0e75 100644 --- a/tests/baselines/reference/jsxFactoryNotIdentifierOrQualifiedName2.symbols +++ b/tests/baselines/reference/jsxFactoryNotIdentifierOrQualifiedName2.symbols @@ -68,12 +68,12 @@ function toCamelCase(text: string): string { >text : Symbol(text, Decl(Element.ts, 26, 21)) return text[0].toLowerCase() + text.substring(1); ->text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) +>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) ->text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) +>text.substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) } === tests/cases/compiler/test.tsx === diff --git a/tests/baselines/reference/jsxFactoryQualifiedName.symbols b/tests/baselines/reference/jsxFactoryQualifiedName.symbols index f20470ebb6b37..88670c2eb0e75 100644 --- a/tests/baselines/reference/jsxFactoryQualifiedName.symbols +++ b/tests/baselines/reference/jsxFactoryQualifiedName.symbols @@ -68,12 +68,12 @@ function toCamelCase(text: string): string { >text : Symbol(text, Decl(Element.ts, 26, 21)) return text[0].toLowerCase() + text.substring(1); ->text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) +>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) ->text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es6.d.ts, --, --)) +>text.substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) >text : Symbol(text, Decl(Element.ts, 26, 21)) ->substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es6.d.ts, --, --)) } === tests/cases/compiler/test.tsx === diff --git a/tests/baselines/reference/lambdaArgCrash.symbols b/tests/baselines/reference/lambdaArgCrash.symbols index 76f3f70513560..dc1187f4be509 100644 --- a/tests/baselines/reference/lambdaArgCrash.symbols +++ b/tests/baselines/reference/lambdaArgCrash.symbols @@ -25,11 +25,11 @@ class Event { /// The callback function to register. this._listeners.push(listener); ->this._listeners.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>this._listeners.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this._listeners : Symbol(Event._listeners, Decl(lambdaArgCrash.ts, 0, 13)) >this : Symbol(Event, Decl(lambdaArgCrash.ts, 0, 0)) >_listeners : Symbol(Event._listeners, Decl(lambdaArgCrash.ts, 0, 13)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >listener : Symbol(listener, Decl(lambdaArgCrash.ts, 12, 6)) } diff --git a/tests/baselines/reference/letConstInCaseClauses.errors.txt b/tests/baselines/reference/letConstInCaseClauses.errors.txt index ae56fe47a799a..ec075327d5aca 100644 --- a/tests/baselines/reference/letConstInCaseClauses.errors.txt +++ b/tests/baselines/reference/letConstInCaseClauses.errors.txt @@ -1,18 +1,14 @@ -tests/cases/compiler/letConstInCaseClauses.ts(6,5): error TS2304: Cannot find name 'console'. -tests/cases/compiler/letConstInCaseClauses.ts(20,5): error TS2304: Cannot find name 'console'. tests/cases/compiler/letConstInCaseClauses.ts(22,14): error TS2678: Type '10' is not comparable to type '1'. tests/cases/compiler/letConstInCaseClauses.ts(26,14): error TS2678: Type '10' is not comparable to type '2'. -==== tests/cases/compiler/letConstInCaseClauses.ts (4 errors) ==== +==== tests/cases/compiler/letConstInCaseClauses.ts (2 errors) ==== var x = 10; var y = 20; { let x = 1; let y = 2; console.log(x) - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. switch (x) { case 10: let x = 20; @@ -27,8 +23,6 @@ tests/cases/compiler/letConstInCaseClauses.ts(26,14): error TS2678: Type '10' is const x = 1; const y = 2; console.log(x) - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. switch (x) { case 10: ~~ diff --git a/tests/baselines/reference/letConstInCaseClauses.symbols b/tests/baselines/reference/letConstInCaseClauses.symbols index 4d71a465b1e2b..23bf9dc6553e9 100644 --- a/tests/baselines/reference/letConstInCaseClauses.symbols +++ b/tests/baselines/reference/letConstInCaseClauses.symbols @@ -12,6 +12,9 @@ var y = 20; >y : Symbol(y, Decl(letConstInCaseClauses.ts, 4, 7)) console.log(x) +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(letConstInCaseClauses.ts, 3, 7)) switch (x) { @@ -38,6 +41,9 @@ var y = 20; >y : Symbol(y, Decl(letConstInCaseClauses.ts, 18, 9)) console.log(x) +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(letConstInCaseClauses.ts, 17, 9)) switch (x) { diff --git a/tests/baselines/reference/letConstInCaseClauses.types b/tests/baselines/reference/letConstInCaseClauses.types index 5db4f3158dc97..5f09eaba7ed72 100644 --- a/tests/baselines/reference/letConstInCaseClauses.types +++ b/tests/baselines/reference/letConstInCaseClauses.types @@ -16,10 +16,10 @@ var y = 20; >2 : 2 console.log(x) ->console.log(x) : any ->console.log : any ->console : any ->log : any +>console.log(x) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >x : number switch (x) { @@ -54,10 +54,10 @@ var y = 20; >2 : 2 console.log(x) ->console.log(x) : any ->console.log : any ->console : any ->log : any +>console.log(x) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >x : 1 switch (x) { diff --git a/tests/baselines/reference/letDeclarations-access.symbols b/tests/baselines/reference/letDeclarations-access.symbols index 31a64fab3f811..eb1f0c85802d8 100644 --- a/tests/baselines/reference/letDeclarations-access.symbols +++ b/tests/baselines/reference/letDeclarations-access.symbols @@ -80,7 +80,7 @@ x; >x : Symbol(x, Decl(letDeclarations-access.ts, 0, 3)) x.toString(); ->x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>x.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(letDeclarations-access.ts, 0, 3)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/letShadowedByNameInNestedScope.errors.txt b/tests/baselines/reference/letShadowedByNameInNestedScope.errors.txt deleted file mode 100644 index b47e194f93eb1..0000000000000 --- a/tests/baselines/reference/letShadowedByNameInNestedScope.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -tests/cases/compiler/letShadowedByNameInNestedScope.ts(6,9): error TS2304: Cannot find name 'console'. - - -==== tests/cases/compiler/letShadowedByNameInNestedScope.ts (1 errors) ==== - var x; - function foo() { - let x = 0; - (function () { - var _x = 1; - console.log(x); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - })(); - } \ No newline at end of file diff --git a/tests/baselines/reference/letShadowedByNameInNestedScope.symbols b/tests/baselines/reference/letShadowedByNameInNestedScope.symbols index 3f1b021ccadbd..98b6d1fe8a46d 100644 --- a/tests/baselines/reference/letShadowedByNameInNestedScope.symbols +++ b/tests/baselines/reference/letShadowedByNameInNestedScope.symbols @@ -13,6 +13,9 @@ function foo() { >_x : Symbol(_x, Decl(letShadowedByNameInNestedScope.ts, 4, 11)) console.log(x); +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(letShadowedByNameInNestedScope.ts, 2, 7)) })(); diff --git a/tests/baselines/reference/letShadowedByNameInNestedScope.types b/tests/baselines/reference/letShadowedByNameInNestedScope.types index 9f7636aa2cc9d..925769d5359bc 100644 --- a/tests/baselines/reference/letShadowedByNameInNestedScope.types +++ b/tests/baselines/reference/letShadowedByNameInNestedScope.types @@ -19,10 +19,10 @@ function foo() { >1 : 1 console.log(x); ->console.log(x) : any ->console.log : any ->console : any ->log : any +>console.log(x) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >x : number })(); diff --git a/tests/baselines/reference/libdtsFix.symbols b/tests/baselines/reference/libdtsFix.symbols index 5399b7150e463..f3b6b014de5fb 100644 --- a/tests/baselines/reference/libdtsFix.symbols +++ b/tests/baselines/reference/libdtsFix.symbols @@ -1,6 +1,6 @@ === tests/cases/compiler/libdtsFix.ts === interface HTMLElement { ->HTMLElement : Symbol(HTMLElement, Decl(libdtsFix.ts, 0, 0)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(libdtsFix.ts, 0, 0)) type: string; >type : Symbol(HTMLElement.type, Decl(libdtsFix.ts, 0, 23)) diff --git a/tests/baselines/reference/library-reference-2.trace.json b/tests/baselines/reference/library-reference-2.trace.json index e708d11c4647f..d48ca68145daf 100644 --- a/tests/baselines/reference/library-reference-2.trace.json +++ b/tests/baselines/reference/library-reference-2.trace.json @@ -7,7 +7,7 @@ "File '/types/jquery/jquery.d.ts' exist - use it as a name resolution result.", "Resolving real path for '/types/jquery/jquery.d.ts', result '/types/jquery/jquery.d.ts'.", "======== Type reference directive 'jquery' was successfully resolved to '/types/jquery/jquery.d.ts', primary: true. ========", - "======== Resolving type reference directive 'jquery', containing file 'test/__inferred type names__.ts', root directory '/types'. ========", + "======== Resolving type reference directive 'jquery', containing file '/test/__inferred type names__.ts', root directory '/types'. ========", "Resolving with primary search path '/types'.", "Found 'package.json' at '/types/jquery/package.json'.", "'package.json' does not have a 'typings' field.", diff --git a/tests/baselines/reference/library_DatePrototypeProperties.symbols b/tests/baselines/reference/library_DatePrototypeProperties.symbols index 1b725fbf84c3f..d35c2b6ab37b4 100644 --- a/tests/baselines/reference/library_DatePrototypeProperties.symbols +++ b/tests/baselines/reference/library_DatePrototypeProperties.symbols @@ -4,308 +4,308 @@ Date.prototype.constructor; >Date.prototype.constructor : Symbol(Object.constructor, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >constructor : Symbol(Object.constructor, Decl(lib.d.ts, --, --)) Date.prototype.toString(); >Date.prototype.toString : Symbol(Date.toString, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toString : Symbol(Date.toString, Decl(lib.d.ts, --, --)) Date.prototype.toDateString(); >Date.prototype.toDateString : Symbol(Date.toDateString, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toDateString : Symbol(Date.toDateString, Decl(lib.d.ts, --, --)) Date.prototype.toTimeString(); >Date.prototype.toTimeString : Symbol(Date.toTimeString, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toTimeString : Symbol(Date.toTimeString, Decl(lib.d.ts, --, --)) Date.prototype.toLocaleString(); >Date.prototype.toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toLocaleString : Symbol(Date.toLocaleString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) Date.prototype.toLocaleDateString(); >Date.prototype.toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toLocaleDateString : Symbol(Date.toLocaleDateString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) Date.prototype.toLocaleTimeString(); >Date.prototype.toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toLocaleTimeString : Symbol(Date.toLocaleTimeString, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) Date.prototype.valueOf(); >Date.prototype.valueOf : Symbol(Date.valueOf, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >valueOf : Symbol(Date.valueOf, Decl(lib.d.ts, --, --)) Date.prototype.getTime(); >Date.prototype.getTime : Symbol(Date.getTime, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getTime : Symbol(Date.getTime, Decl(lib.d.ts, --, --)) Date.prototype.getFullYear(); >Date.prototype.getFullYear : Symbol(Date.getFullYear, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getFullYear : Symbol(Date.getFullYear, Decl(lib.d.ts, --, --)) Date.prototype.getUTCFullYear(); >Date.prototype.getUTCFullYear : Symbol(Date.getUTCFullYear, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getUTCFullYear : Symbol(Date.getUTCFullYear, Decl(lib.d.ts, --, --)) Date.prototype.getMonth(); >Date.prototype.getMonth : Symbol(Date.getMonth, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getMonth : Symbol(Date.getMonth, Decl(lib.d.ts, --, --)) Date.prototype.getUTCMonth(); >Date.prototype.getUTCMonth : Symbol(Date.getUTCMonth, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getUTCMonth : Symbol(Date.getUTCMonth, Decl(lib.d.ts, --, --)) Date.prototype.getDate(); >Date.prototype.getDate : Symbol(Date.getDate, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getDate : Symbol(Date.getDate, Decl(lib.d.ts, --, --)) Date.prototype.getUTCDate(); >Date.prototype.getUTCDate : Symbol(Date.getUTCDate, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getUTCDate : Symbol(Date.getUTCDate, Decl(lib.d.ts, --, --)) Date.prototype.getDay(); >Date.prototype.getDay : Symbol(Date.getDay, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getDay : Symbol(Date.getDay, Decl(lib.d.ts, --, --)) Date.prototype.getUTCDay(); >Date.prototype.getUTCDay : Symbol(Date.getUTCDay, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getUTCDay : Symbol(Date.getUTCDay, Decl(lib.d.ts, --, --)) Date.prototype.getHours(); >Date.prototype.getHours : Symbol(Date.getHours, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getHours : Symbol(Date.getHours, Decl(lib.d.ts, --, --)) Date.prototype.getUTCHours(); >Date.prototype.getUTCHours : Symbol(Date.getUTCHours, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getUTCHours : Symbol(Date.getUTCHours, Decl(lib.d.ts, --, --)) Date.prototype.getMinutes(); >Date.prototype.getMinutes : Symbol(Date.getMinutes, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getMinutes : Symbol(Date.getMinutes, Decl(lib.d.ts, --, --)) Date.prototype.getUTCMinutes(); >Date.prototype.getUTCMinutes : Symbol(Date.getUTCMinutes, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getUTCMinutes : Symbol(Date.getUTCMinutes, Decl(lib.d.ts, --, --)) Date.prototype.getSeconds(); >Date.prototype.getSeconds : Symbol(Date.getSeconds, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getSeconds : Symbol(Date.getSeconds, Decl(lib.d.ts, --, --)) Date.prototype.getUTCSeconds(); >Date.prototype.getUTCSeconds : Symbol(Date.getUTCSeconds, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getUTCSeconds : Symbol(Date.getUTCSeconds, Decl(lib.d.ts, --, --)) Date.prototype.getMilliseconds(); >Date.prototype.getMilliseconds : Symbol(Date.getMilliseconds, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getMilliseconds : Symbol(Date.getMilliseconds, Decl(lib.d.ts, --, --)) Date.prototype.getUTCMilliseconds(); >Date.prototype.getUTCMilliseconds : Symbol(Date.getUTCMilliseconds, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getUTCMilliseconds : Symbol(Date.getUTCMilliseconds, Decl(lib.d.ts, --, --)) Date.prototype.getTimezoneOffset(); >Date.prototype.getTimezoneOffset : Symbol(Date.getTimezoneOffset, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >getTimezoneOffset : Symbol(Date.getTimezoneOffset, Decl(lib.d.ts, --, --)) Date.prototype.setTime(0); >Date.prototype.setTime : Symbol(Date.setTime, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setTime : Symbol(Date.setTime, Decl(lib.d.ts, --, --)) Date.prototype.setMilliseconds(0); >Date.prototype.setMilliseconds : Symbol(Date.setMilliseconds, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setMilliseconds : Symbol(Date.setMilliseconds, Decl(lib.d.ts, --, --)) Date.prototype.setUTCMilliseconds(0); >Date.prototype.setUTCMilliseconds : Symbol(Date.setUTCMilliseconds, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setUTCMilliseconds : Symbol(Date.setUTCMilliseconds, Decl(lib.d.ts, --, --)) Date.prototype.setSeconds(0); >Date.prototype.setSeconds : Symbol(Date.setSeconds, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setSeconds : Symbol(Date.setSeconds, Decl(lib.d.ts, --, --)) Date.prototype.setUTCSeconds(0); >Date.prototype.setUTCSeconds : Symbol(Date.setUTCSeconds, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setUTCSeconds : Symbol(Date.setUTCSeconds, Decl(lib.d.ts, --, --)) Date.prototype.setMinutes(0); >Date.prototype.setMinutes : Symbol(Date.setMinutes, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setMinutes : Symbol(Date.setMinutes, Decl(lib.d.ts, --, --)) Date.prototype.setUTCMinutes(0); >Date.prototype.setUTCMinutes : Symbol(Date.setUTCMinutes, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setUTCMinutes : Symbol(Date.setUTCMinutes, Decl(lib.d.ts, --, --)) Date.prototype.setHours(0); >Date.prototype.setHours : Symbol(Date.setHours, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setHours : Symbol(Date.setHours, Decl(lib.d.ts, --, --)) Date.prototype.setUTCHours(0); >Date.prototype.setUTCHours : Symbol(Date.setUTCHours, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setUTCHours : Symbol(Date.setUTCHours, Decl(lib.d.ts, --, --)) Date.prototype.setDate(0); >Date.prototype.setDate : Symbol(Date.setDate, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setDate : Symbol(Date.setDate, Decl(lib.d.ts, --, --)) Date.prototype.setUTCDate(0); >Date.prototype.setUTCDate : Symbol(Date.setUTCDate, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setUTCDate : Symbol(Date.setUTCDate, Decl(lib.d.ts, --, --)) Date.prototype.setMonth(0); >Date.prototype.setMonth : Symbol(Date.setMonth, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setMonth : Symbol(Date.setMonth, Decl(lib.d.ts, --, --)) Date.prototype.setUTCMonth(0); >Date.prototype.setUTCMonth : Symbol(Date.setUTCMonth, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setUTCMonth : Symbol(Date.setUTCMonth, Decl(lib.d.ts, --, --)) Date.prototype.setFullYear(0); >Date.prototype.setFullYear : Symbol(Date.setFullYear, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setFullYear : Symbol(Date.setFullYear, Decl(lib.d.ts, --, --)) Date.prototype.setUTCFullYear(0); >Date.prototype.setUTCFullYear : Symbol(Date.setUTCFullYear, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >setUTCFullYear : Symbol(Date.setUTCFullYear, Decl(lib.d.ts, --, --)) Date.prototype.toUTCString(); >Date.prototype.toUTCString : Symbol(Date.toUTCString, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toUTCString : Symbol(Date.toUTCString, Decl(lib.d.ts, --, --)) Date.prototype.toISOString(); >Date.prototype.toISOString : Symbol(Date.toISOString, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toISOString : Symbol(Date.toISOString, Decl(lib.d.ts, --, --)) Date.prototype.toJSON(null); >Date.prototype.toJSON : Symbol(Date.toJSON, Decl(lib.d.ts, --, --)) >Date.prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(DateConstructor.prototype, Decl(lib.d.ts, --, --)) >toJSON : Symbol(Date.toJSON, Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/localClassesInLoop_ES6.symbols b/tests/baselines/reference/localClassesInLoop_ES6.symbols index 582eca51f041a..d034881f1e463 100644 --- a/tests/baselines/reference/localClassesInLoop_ES6.symbols +++ b/tests/baselines/reference/localClassesInLoop_ES6.symbols @@ -16,9 +16,9 @@ for (let x = 0; x < 2; ++x) { >C : Symbol(C, Decl(localClassesInLoop_ES6.ts, 4, 29)) data.push(() => C); ->data.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>data.push : Symbol(Array.push, Decl(lib.es6.d.ts, --, --)) >data : Symbol(data, Decl(localClassesInLoop_ES6.ts, 3, 3)) ->push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es6.d.ts, --, --)) >C : Symbol(C, Decl(localClassesInLoop_ES6.ts, 4, 29)) } diff --git a/tests/baselines/reference/localTypes5.symbols b/tests/baselines/reference/localTypes5.symbols index 175469e7a7257..dc0e3c8012089 100644 --- a/tests/baselines/reference/localTypes5.symbols +++ b/tests/baselines/reference/localTypes5.symbols @@ -22,7 +22,7 @@ function foo() { >Y : Symbol(Y, Decl(localTypes5.ts, 3, 36)) })(); ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } } var x = new X(); diff --git a/tests/baselines/reference/mappedTypeErrors.symbols b/tests/baselines/reference/mappedTypeErrors.symbols index 38d0a0bc72f36..2e4ddb47cbf7f 100644 --- a/tests/baselines/reference/mappedTypeErrors.symbols +++ b/tests/baselines/reference/mappedTypeErrors.symbols @@ -46,12 +46,12 @@ type T01 = { [P in number]: string }; // Error type T02 = { [P in Date]: number }; // Error >T02 : Symbol(T02, Decl(mappedTypeErrors.ts, 19, 37)) >P : Symbol(P, Decl(mappedTypeErrors.ts, 20, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type T03 = Record; // Error >T03 : Symbol(T03, Decl(mappedTypeErrors.ts, 20, 35)) >Record : Symbol(Record, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type T10 = Pick; >T10 : Symbol(T10, Decl(mappedTypeErrors.ts, 21, 32)) diff --git a/tests/baselines/reference/mappedTypes1.symbols b/tests/baselines/reference/mappedTypes1.symbols index e012b49ddf42a..8cafc799d8476 100644 --- a/tests/baselines/reference/mappedTypes1.symbols +++ b/tests/baselines/reference/mappedTypes1.symbols @@ -24,7 +24,7 @@ type T03 = { [P in keyof Item]: Date }; >T03 : Symbol(T03, Decl(mappedTypes1.ts, 4, 41)) >P : Symbol(P, Decl(mappedTypes1.ts, 5, 14)) >Item : Symbol(Item, Decl(mappedTypes1.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) type T10 = { [P in keyof Item]: Item[P] }; >T10 : Symbol(T10, Decl(mappedTypes1.ts, 5, 39)) diff --git a/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols b/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols index bb197a97aeb35..3e5cabf4184ef 100644 --- a/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols +++ b/tests/baselines/reference/mergedInterfaceFromMultipleFiles1.symbols @@ -11,7 +11,7 @@ interface C extends D { b(): Date; >b : Symbol(C.b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var c:C; @@ -38,7 +38,7 @@ var d: number = c.a(); var e: Date = c.b(); >e : Symbol(e, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 12, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >c.b : Symbol(C.b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) >c : Symbol(c, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 8, 3)) >b : Symbol(C.b, Decl(mergedInterfaceFromMultipleFiles1_1.ts, 4, 23)) diff --git a/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols index de2bff45743a7..e38829534b2a8 100644 --- a/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols +++ b/tests/baselines/reference/mergedInterfacesWithMultipleBases3.symbols @@ -69,7 +69,7 @@ class D implements A { b: Date; >b : Symbol(D.b, Decl(mergedInterfacesWithMultipleBases3.ts, 28, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) c: string; >c : Symbol(D.c, Decl(mergedInterfacesWithMultipleBases3.ts, 29, 12)) diff --git a/tests/baselines/reference/mixinClassesAnonymous.symbols b/tests/baselines/reference/mixinClassesAnonymous.symbols index bd709501f3106..d65b103f8d184 100644 --- a/tests/baselines/reference/mixinClassesAnonymous.symbols +++ b/tests/baselines/reference/mixinClassesAnonymous.symbols @@ -181,7 +181,7 @@ const Timestamped = >(Base: CT) => { timestamp = new Date(); >timestamp : Symbol((Anonymous class).timestamp, Decl(mixinClassesAnonymous.ts, 60, 31)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }; } diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt b/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt deleted file mode 100644 index bc7f41ad0c759..0000000000000 --- a/tests/baselines/reference/multiExtendsSplitInterfaces1.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/compiler/multiExtendsSplitInterfaces1.ts(1,1): error TS2304: Cannot find name 'self'. - - -==== tests/cases/compiler/multiExtendsSplitInterfaces1.ts (1 errors) ==== - self.cancelAnimationFrame(0); - ~~~~ -!!! error TS2304: Cannot find name 'self'. \ No newline at end of file diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces1.symbols b/tests/baselines/reference/multiExtendsSplitInterfaces1.symbols index bd4b4052cf3d2..c8c04f39ad452 100644 --- a/tests/baselines/reference/multiExtendsSplitInterfaces1.symbols +++ b/tests/baselines/reference/multiExtendsSplitInterfaces1.symbols @@ -1,3 +1,6 @@ === tests/cases/compiler/multiExtendsSplitInterfaces1.ts === self.cancelAnimationFrame(0); -No type information for this code. \ No newline at end of file +>self.cancelAnimationFrame : Symbol(Window.cancelAnimationFrame, Decl(lib.d.ts, --, --)) +>self : Symbol(self, Decl(lib.d.ts, --, --)) +>cancelAnimationFrame : Symbol(Window.cancelAnimationFrame, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/multiExtendsSplitInterfaces1.types b/tests/baselines/reference/multiExtendsSplitInterfaces1.types index 8465777eeb0cc..3ebdfffb12ebb 100644 --- a/tests/baselines/reference/multiExtendsSplitInterfaces1.types +++ b/tests/baselines/reference/multiExtendsSplitInterfaces1.types @@ -1,8 +1,8 @@ === tests/cases/compiler/multiExtendsSplitInterfaces1.ts === self.cancelAnimationFrame(0); ->self.cancelAnimationFrame(0) : any ->self.cancelAnimationFrame : any ->self : any ->cancelAnimationFrame : any +>self.cancelAnimationFrame(0) : void +>self.cancelAnimationFrame : (handle: number) => void +>self : Window +>cancelAnimationFrame : (handle: number) => void >0 : 0 diff --git a/tests/baselines/reference/narrowFromAnyWithInstanceof.symbols b/tests/baselines/reference/narrowFromAnyWithInstanceof.symbols index f0757b7aa3379..6203a2d096b4b 100644 --- a/tests/baselines/reference/narrowFromAnyWithInstanceof.symbols +++ b/tests/baselines/reference/narrowFromAnyWithInstanceof.symbols @@ -45,7 +45,7 @@ if (x instanceof Error) { // 'any' is narrowed to types other than 'Function'/'O if (x instanceof Date) { >x : Symbol(x, Decl(narrowFromAnyWithInstanceof.ts, 0, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) x.getDate(); >x.getDate : Symbol(Date.getDate, Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/narrowFromAnyWithTypePredicate.symbols b/tests/baselines/reference/narrowFromAnyWithTypePredicate.symbols index dd7750a9c0759..ac25fde581b75 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.symbols +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.symbols @@ -29,7 +29,7 @@ declare function isDate(x): x is Date; >isDate : Symbol(isDate, Decl(narrowFromAnyWithTypePredicate.ts, 4, 40)) >x : Symbol(x, Decl(narrowFromAnyWithTypePredicate.ts, 5, 24)) >x : Symbol(x, Decl(narrowFromAnyWithTypePredicate.ts, 5, 24)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) if (isFunction(x)) { // 'any' is not narrowed when target type is 'Function' diff --git a/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols b/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols index ddb09c3140357..39fa693a14661 100644 --- a/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols +++ b/tests/baselines/reference/newNamesInGlobalAugmentations1.symbols @@ -12,7 +12,7 @@ declare global { >global : Symbol(global, Decl(f1.d.ts, 4, 1)) interface SymbolConstructor { ->SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(f1.d.ts, 5, 16)) +>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(f1.d.ts, 5, 16)) observable: symbol; >observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 6, 33)) @@ -35,7 +35,7 @@ declare global { === tests/cases/compiler/main.ts === Symbol.observable; >Symbol.observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 6, 33)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >observable : Symbol(SymbolConstructor.observable, Decl(f1.d.ts, 6, 33)) new Cls().x diff --git a/tests/baselines/reference/newOperator.symbols b/tests/baselines/reference/newOperator.symbols index c5bfc77f5cb99..de20d11ddf242 100644 --- a/tests/baselines/reference/newOperator.symbols +++ b/tests/baselines/reference/newOperator.symbols @@ -9,11 +9,11 @@ var i = new ifc(); // Parens are optional var x = new Date; >x : Symbol(x, Decl(newOperator.ts, 5, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var y = new Date(); >y : Symbol(y, Decl(newOperator.ts, 6, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Target is not a class or var, good error var t1 = new 53(); @@ -27,7 +27,7 @@ new string; // Use in LHS of expression? (new Date()).toString(); >(new Date()).toString : Symbol(Date.toString, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >toString : Symbol(Date.toString, Decl(lib.d.ts, --, --)) // Various spacing @@ -51,7 +51,7 @@ var f = new q(); // not legal var t5 = new new Date; >t5 : Symbol(t5, Decl(newOperator.ts, 30, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Can be an expression new String; diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols index 45115b278ad28..38597019c4f9e 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.symbols @@ -1,6 +1,6 @@ === tests/cases/compiler/noCollisionThisExpressionAndLocalVarInLambda.ts === declare function alert(message?: any): void; ->alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) >message : Symbol(message, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 23)) var x = { @@ -19,11 +19,11 @@ var x = { } } alert(x.doStuff(x => alert(x))); ->alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) >x.doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 9)) >x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 3)) >doStuff : Symbol(doStuff, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 1, 9)) >x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 7, 16)) ->alert : Symbol(alert, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 0, 0)) >x : Symbol(x, Decl(noCollisionThisExpressionAndLocalVarInLambda.ts, 7, 16)) diff --git a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types index a0a9a25c516c2..88caf899acdde 100644 --- a/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types +++ b/tests/baselines/reference/noCollisionThisExpressionAndLocalVarInLambda.types @@ -1,6 +1,6 @@ === tests/cases/compiler/noCollisionThisExpressionAndLocalVarInLambda.ts === declare function alert(message?: any): void; ->alert : (message?: any) => void +>alert : { (message?: any): void; (message?: any): void; } >message : any var x = { @@ -25,7 +25,7 @@ var x = { } alert(x.doStuff(x => alert(x))); >alert(x.doStuff(x => alert(x))) : void ->alert : (message?: any) => void +>alert : { (message?: any): void; (message?: any): void; } >x.doStuff(x => alert(x)) : () => any >x.doStuff : (callback: any) => () => any >x : { doStuff: (callback: any) => () => any; } @@ -33,6 +33,6 @@ alert(x.doStuff(x => alert(x))); >x => alert(x) : (x: any) => void >x : any >alert(x) : void ->alert : (message?: any) => void +>alert : { (message?: any): void; (message?: any): void; } >x : any diff --git a/tests/baselines/reference/noImplicitReturnsInAsync1.symbols b/tests/baselines/reference/noImplicitReturnsInAsync1.symbols index b039eb555f73e..3717c07625bc0 100644 --- a/tests/baselines/reference/noImplicitReturnsInAsync1.symbols +++ b/tests/baselines/reference/noImplicitReturnsInAsync1.symbols @@ -10,7 +10,7 @@ async function test(isError: boolean = false) { } let x = await Promise.resolve("The test is passed without an error."); >x : Symbol(x, Decl(noImplicitReturnsInAsync1.ts, 4, 7)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/noImplicitReturnsInAsync2.symbols b/tests/baselines/reference/noImplicitReturnsInAsync2.symbols index 8bea8772e893b..097b5ef7cec05 100644 --- a/tests/baselines/reference/noImplicitReturnsInAsync2.symbols +++ b/tests/baselines/reference/noImplicitReturnsInAsync2.symbols @@ -28,7 +28,7 @@ async function test4(isError: boolean = true) { async function test5(isError: boolean = true): Promise { //should not be error >test5 : Symbol(test5, Decl(noImplicitReturnsInAsync2.ts, 12, 1)) >isError : Symbol(isError, Decl(noImplicitReturnsInAsync2.ts, 15, 21)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) if (isError === true) { >isError : Symbol(isError, Decl(noImplicitReturnsInAsync2.ts, 15, 21)) @@ -43,7 +43,7 @@ async function test5(isError: boolean = true): Promise { //should not be er async function test6(isError: boolean = true): Promise { >test6 : Symbol(test6, Decl(noImplicitReturnsInAsync2.ts, 19, 1)) >isError : Symbol(isError, Decl(noImplicitReturnsInAsync2.ts, 23, 21)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) if (isError === true) { >isError : Symbol(isError, Decl(noImplicitReturnsInAsync2.ts, 23, 21)) diff --git a/tests/baselines/reference/nullAssignableToEveryType.symbols b/tests/baselines/reference/nullAssignableToEveryType.symbols index 969686563a3b5..9212d6df49968 100644 --- a/tests/baselines/reference/nullAssignableToEveryType.symbols +++ b/tests/baselines/reference/nullAssignableToEveryType.symbols @@ -38,7 +38,7 @@ var d: boolean = null; var e: Date = null; >e : Symbol(e, Decl(nullAssignableToEveryType.ts, 15, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var f: any = null; >f : Symbol(f, Decl(nullAssignableToEveryType.ts, 16, 3)) @@ -100,7 +100,7 @@ function foo(x: T, y: U, z: V) { >T : Symbol(T, Decl(nullAssignableToEveryType.ts, 32, 13)) >U : Symbol(U, Decl(nullAssignableToEveryType.ts, 32, 15)) >V : Symbol(V, Decl(nullAssignableToEveryType.ts, 32, 18)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(nullAssignableToEveryType.ts, 32, 35)) >T : Symbol(T, Decl(nullAssignableToEveryType.ts, 32, 13)) >y : Symbol(y, Decl(nullAssignableToEveryType.ts, 32, 40)) diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols index 3d4fb84145e71..536bf6b2ec9a4 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.symbols @@ -39,11 +39,11 @@ var r3 = true ? null : true; var r4 = true ? new Date() : null; >r4 : Symbol(r4, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 18, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 19, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r4 = true ? null : new Date(); >r4 : Symbol(r4, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 18, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 19, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r5 = true ? /1/ : null; >r5 : Symbol(r5, Decl(nullIsSubtypeOfEverythingButUndefined.ts, 21, 3), Decl(nullIsSubtypeOfEverythingButUndefined.ts, 22, 3)) diff --git a/tests/baselines/reference/numericIndexerConstraint5.symbols b/tests/baselines/reference/numericIndexerConstraint5.symbols index ff4183c9e9a5f..6cfc8db1e1799 100644 --- a/tests/baselines/reference/numericIndexerConstraint5.symbols +++ b/tests/baselines/reference/numericIndexerConstraint5.symbols @@ -2,7 +2,7 @@ var x = { name: "x", 0: new Date() }; >x : Symbol(x, Decl(numericIndexerConstraint5.ts, 0, 3)) >name : Symbol(name, Decl(numericIndexerConstraint5.ts, 0, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var z: { [name: number]: string } = x; >z : Symbol(z, Decl(numericIndexerConstraint5.ts, 1, 3)) diff --git a/tests/baselines/reference/numericIndexerTyping1.symbols b/tests/baselines/reference/numericIndexerTyping1.symbols index cf894348af4c4..110eff563fb42 100644 --- a/tests/baselines/reference/numericIndexerTyping1.symbols +++ b/tests/baselines/reference/numericIndexerTyping1.symbols @@ -4,7 +4,7 @@ interface I { [x: string]: Date; >x : Symbol(x, Decl(numericIndexerTyping1.ts, 1, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } interface I2 extends I { diff --git a/tests/baselines/reference/numericIndexerTyping2.symbols b/tests/baselines/reference/numericIndexerTyping2.symbols index 1f1aa7edc99c0..c5e4c3b4c9833 100644 --- a/tests/baselines/reference/numericIndexerTyping2.symbols +++ b/tests/baselines/reference/numericIndexerTyping2.symbols @@ -4,7 +4,7 @@ class I { [x: string]: Date >x : Symbol(x, Decl(numericIndexerTyping2.ts, 1, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } class I2 extends I { diff --git a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols index a7223a8df30bd..76bbea5a1959d 100644 --- a/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols +++ b/tests/baselines/reference/numericLiteralsWithTrailingDecimalPoints01.symbols @@ -1,11 +1,11 @@ === tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts === 1..toString(); ->1..toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>1..toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) 1.0.toString(); ->1.0.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>1.0.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) 1.toString(); >toString : Symbol(toString, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 8, 14)) @@ -18,9 +18,9 @@ var i: number = 1; var test1 = i.toString(); >test1 : Symbol(test1, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 7, 3)) ->i.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>i.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 6, 3)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var test2 = 2.toString(); >test2 : Symbol(test2, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 8, 3)) @@ -28,35 +28,35 @@ var test2 = 2.toString(); var test3 = 3 .toString(); >test3 : Symbol(test3, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 9, 3)) ->3 .toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>3 .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var test4 = 3 .toString(); >test4 : Symbol(test4, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 10, 3)) ->3 .toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>3 .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var test5 = 3 .toString(); >test5 : Symbol(test5, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 11, 3)) ->3 .toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>3 .toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var test6 = 3.['toString'](); >test6 : Symbol(test6, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 12, 3)) ->'toString' : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>'toString' : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var test7 = 3 >test7 : Symbol(test7, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 13, 3)) ->3.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>3.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) .toString(); ->toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var test8 = new Number(4).toString(); >test8 : Symbol(test8, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 15, 3)) ->new Number(4).toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) ->Number : Symbol(Number, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) +>new Number(4).toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) var test9 = 3. + 3. >test9 : Symbol(test9, Decl(numericLiteralsWithTrailingDecimalPoints01.ts, 16, 3)) diff --git a/tests/baselines/reference/objectLiteralGettersAndSetters.symbols b/tests/baselines/reference/objectLiteralGettersAndSetters.symbols index 5a4250f9c8239..72f74f4bd2b47 100644 --- a/tests/baselines/reference/objectLiteralGettersAndSetters.symbols +++ b/tests/baselines/reference/objectLiteralGettersAndSetters.symbols @@ -144,11 +144,11 @@ var sameType3 = { get x(): any { return undefined; }, set x(n: typeof anyVar) { var sameType4 = { get x(): Date { return undefined; }, set x(n: Date) { } }; >sameType4 : Symbol(sameType4, Decl(objectLiteralGettersAndSetters.ts, 37, 3)) >x : Symbol(x, Decl(objectLiteralGettersAndSetters.ts, 37, 17), Decl(objectLiteralGettersAndSetters.ts, 37, 54)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) >x : Symbol(x, Decl(objectLiteralGettersAndSetters.ts, 37, 17), Decl(objectLiteralGettersAndSetters.ts, 37, 54)) >n : Symbol(n, Decl(objectLiteralGettersAndSetters.ts, 37, 61)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Type of unannotated get accessor return type is the type annotation of the set accessor param var setParamType1 = { diff --git a/tests/baselines/reference/objectRestForOf.symbols b/tests/baselines/reference/objectRestForOf.symbols index 2d5d6a2bb2d99..2a384ce092341 100644 --- a/tests/baselines/reference/objectRestForOf.symbols +++ b/tests/baselines/reference/objectRestForOf.symbols @@ -32,9 +32,9 @@ for ({ x: xx, ...rrestOff } of array ) { } for (const norest of array.map(a => ({ ...a, x: 'a string' }))) { >norest : Symbol(norest, Decl(objectRestForOf.ts, 9, 10)) ->array.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>array.map : Symbol(Array.map, Decl(lib.es6.d.ts, --, --)) >array : Symbol(array, Decl(objectRestForOf.ts, 0, 3)) ->map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(objectRestForOf.ts, 9, 31)) >a : Symbol(a, Decl(objectRestForOf.ts, 9, 31)) >x : Symbol(x, Decl(objectRestForOf.ts, 9, 44)) diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.symbols b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.symbols index 8cc5c7bf3d600..19de6a0483874 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.symbols +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.symbols @@ -15,7 +15,7 @@ class B extends A { } interface Object { ->Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(objectTypeHidingMembersOfExtendedObject.ts, 6, 1)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(objectTypeHidingMembersOfExtendedObject.ts, 6, 1)) data: A; >data : Symbol(Object.data, Decl(objectTypeHidingMembersOfExtendedObject.ts, 8, 18)) @@ -23,7 +23,7 @@ interface Object { [x: string]: Object; >x : Symbol(x, Decl(objectTypeHidingMembersOfExtendedObject.ts, 10, 5)) ->Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(objectTypeHidingMembersOfExtendedObject.ts, 6, 1)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(objectTypeHidingMembersOfExtendedObject.ts, 6, 1)) } class C { diff --git a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.symbols b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.symbols index 19df4ab30fad8..23513514ceef5 100644 --- a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.symbols +++ b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.symbols @@ -3,11 +3,11 @@ // no errors expected below interface Object { ->Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(objectTypeWithStringIndexerHidingObjectIndexer.ts, 0, 0)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(objectTypeWithStringIndexerHidingObjectIndexer.ts, 0, 0)) [x: string]: Object; >x : Symbol(x, Decl(objectTypeWithStringIndexerHidingObjectIndexer.ts, 4, 5)) ->Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(objectTypeWithStringIndexerHidingObjectIndexer.ts, 0, 0)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(objectTypeWithStringIndexerHidingObjectIndexer.ts, 0, 0)) } var o = {}; >o : Symbol(o, Decl(objectTypeWithStringIndexerHidingObjectIndexer.ts, 6, 3)) diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols index 3756411707702..c847291d7b3ce 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.symbols @@ -14,13 +14,13 @@ class C { "1.": string; "1..": boolean; "1.0": Date; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "-1.0": RegExp; >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "-1": Date; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var c: C; @@ -120,13 +120,13 @@ interface I { "1.": string; "1..": boolean; "1.0": Date; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "-1.0": RegExp; >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "-1": Date; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var i: I; @@ -226,13 +226,13 @@ var a: { "1.": string; "1..": boolean; "1.0": Date; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "-1.0": RegExp; >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "-1": Date; ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var r1 = a['0.1']; @@ -328,11 +328,11 @@ var b = { "1.": "", "1..": true, "1.0": new Date(), ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) "-1.0": /123/, "-1": Date ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }; diff --git a/tests/baselines/reference/objectTypesIdentity2.symbols b/tests/baselines/reference/objectTypesIdentity2.symbols index eb04eaf03c7bb..b72bd83653092 100644 --- a/tests/baselines/reference/objectTypesIdentity2.symbols +++ b/tests/baselines/reference/objectTypesIdentity2.symbols @@ -29,7 +29,7 @@ interface I { foo: Date; >foo : Symbol(I.foo, Decl(objectTypesIdentity2.ts, 14, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var a: { foo: RegExp; } diff --git a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols index fb01ef775c4e3..3c4e89482af92 100644 --- a/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithCallSignatures2.symbols @@ -51,7 +51,7 @@ var a: { foo(x: Date): string } >a : Symbol(a, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 3)) >foo : Symbol(foo, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 8)) >x : Symbol(x, Decl(objectTypesIdentityWithCallSignatures2.ts, 22, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var b = { foo(x: RegExp) { return ''; } }; >b : Symbol(b, Decl(objectTypesIdentityWithCallSignatures2.ts, 23, 3)) diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols index 64677b63c5f6d..3f54560782bf9 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.symbols @@ -37,7 +37,7 @@ interface I2 { var a: { new(x: Date): string } >a : Symbol(a, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 3)) >x : Symbol(x, Decl(objectTypesIdentityWithConstructSignatures2.ts, 18, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var b = { new(x: RegExp) { return ''; } }; // not a construct signature, function called new >b : Symbol(b, Decl(objectTypesIdentityWithConstructSignatures2.ts, 19, 3)) diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols index 7d017936a04d8..5e0af45f907b8 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.symbols @@ -9,7 +9,7 @@ class A { foo(x: T): string { return null; } >foo : Symbol(A.foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 4, 9)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 24)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints.ts, 5, 8)) } diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.symbols index e37b606be59ad..ee55a60f59c79 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.symbols @@ -11,7 +11,7 @@ class A { >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 8)) >U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 20)) >U : Symbol(U, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 20)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 37)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 8)) >y : Symbol(y, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByConstraints2.ts, 5, 42)) diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols index a3f4f8038a0c0..6a3b4c81bdf65 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.symbols @@ -41,7 +41,7 @@ interface I { >foo : Symbol(I.foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 16, 16)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 17, 8)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType.ts, 16, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } interface I2 { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols index d90a4b1d54532..f44a4f08d8c88 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.symbols @@ -9,7 +9,7 @@ class A { foo(x: T): string { return null; } >foo : Symbol(A.foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 4, 9)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 24)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 5, 8)) } @@ -17,7 +17,7 @@ class A { class B { >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 8, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo(x: T): number { return null; } >foo : Symbol(B.foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 8, 25)) @@ -28,7 +28,7 @@ class B { class C { >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 12, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo(x: T): boolean { return null; } >foo : Symbol(C.foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 12, 25)) @@ -39,13 +39,13 @@ class C { interface I { >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo(x: T): Date; >foo : Symbol(I.foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 29)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 17, 8)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 16, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } interface I2 { @@ -54,7 +54,7 @@ interface I2 { foo(x: T): RegExp; >foo : Symbol(I2.foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 20, 14)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 24)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 21, 8)) >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) @@ -64,7 +64,7 @@ var a: { foo(x: T): T } >a : Symbol(a, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 3)) >foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 8)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 29)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 24, 13)) @@ -73,7 +73,7 @@ var b = { foo(x: T) { return null; } }; >b : Symbol(b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 3)) >foo : Symbol(foo, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 9)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 30)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 25, 14)) @@ -95,13 +95,13 @@ function foo1b(x: B); >foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 15)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo1b(x: B); // error >foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 15)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo1b(x: any) { } >foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 29, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 31, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 32, 27)) @@ -111,13 +111,13 @@ function foo1c(x: C); >foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo1c(x: C); // error >foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo1c(x: any) { } >foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 33, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 36, 27)) @@ -127,13 +127,13 @@ function foo2(x: I); >foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo2(x: I); // error >foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo2(x: any) { } >foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 37, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 39, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 40, 26)) @@ -176,7 +176,7 @@ function foo5(x: B); // ok >foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 14)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo5(x: any) { } >foo5 : Symbol(foo5, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 51, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 52, 26)) @@ -191,7 +191,7 @@ function foo5b(x: C); // ok >foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo5b(x: any) { } >foo5b : Symbol(foo5b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 53, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 55, 21), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 56, 27)) @@ -206,7 +206,7 @@ function foo6(x: I); // ok >foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo6(x: any) { } >foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 59, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 60, 26)) @@ -230,13 +230,13 @@ function foo8(x: B); >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 14)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo8(x: I); // ok >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo8(x: any) { } >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 65, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 67, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 68, 26)) @@ -246,13 +246,13 @@ function foo9(x: B); >foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 14)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo9(x: C); // ok >foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 14)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo9(x: any) { } >foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 69, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 71, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 72, 26)) @@ -262,7 +262,7 @@ function foo10(x: B); >foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 15)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo10(x: typeof a); // ok >foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 73, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 75, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 76, 28)) @@ -277,7 +277,7 @@ function foo11(x: B); >foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 15)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo11(x: typeof b); // ok >foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 77, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 79, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 80, 28)) @@ -292,13 +292,13 @@ function foo12(x: I); >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12(x: C); // ok >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12(x: any) { } >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 81, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 83, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 84, 27)) @@ -313,7 +313,7 @@ function foo12b(x: C); // ok >foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 16)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12b(x: any) { } >foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 85, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 87, 23), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 88, 28)) @@ -323,7 +323,7 @@ function foo13(x: I); >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo13(x: typeof a); // ok >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 89, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 91, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 92, 28)) @@ -338,7 +338,7 @@ function foo14(x: I); >foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 14, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo14(x: typeof b); // ok >foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 93, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 95, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 96, 28)) @@ -358,7 +358,7 @@ function foo15(x: C); // ok >foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo15(x: any) { } >foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 97, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 99, 22), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingByReturnType2.ts, 100, 27)) diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols index 748c945d8d0fa..75d81b820fb34 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.symbols @@ -211,7 +211,7 @@ function foo6(x: I); // ok >foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 51)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo6(x: any) { } >foo6 : Symbol(foo6, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 57, 20), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 58, 51)) @@ -240,7 +240,7 @@ function foo8(x: I); // error >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 51)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo8(x: any) { } >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 63, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 65, 36), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 66, 51)) @@ -294,14 +294,14 @@ function foo12(x: I, number, Date, string>); >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12(x: C, number, Date>); // error >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 62), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 54)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 8, 1)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 4, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12(x: any) { } >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 79, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 81, 62), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 82, 54)) @@ -325,9 +325,9 @@ function foo13(x: I); >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo13(x: typeof a); // ok >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 87, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 89, 49), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 90, 28)) @@ -342,7 +342,7 @@ function foo14(x: I); >foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 91, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 94, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 93, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts.ts, 12, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo14(x: typeof b); // ok diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols index a69ddbe56470d..61dccbcbfde4c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.symbols @@ -85,7 +85,7 @@ function foo13(x: I); >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo13(x: typeof a); // ok >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 23, 25), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 25, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 26, 28)) @@ -100,7 +100,7 @@ function foo14(x: I); >foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 22)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo14(x: I2); // error >foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 27, 26), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 29, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 30, 22)) @@ -129,7 +129,7 @@ function foo15(x: I); >foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 22)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo15(x: I2); // ok >foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 35, 27), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 37, 52), Decl(objectTypesIdentityWithGenericCallSignaturesDifferingTypeParameterCounts2.ts, 38, 22)) diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols index 418ed27a99dbb..308bce89f5037 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.symbols @@ -28,7 +28,7 @@ interface I { new(x: T): Date; >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 13, 8)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.ts, 12, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } interface I2 { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols index 23702ebab68ab..55b2a0842288c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.symbols @@ -6,7 +6,7 @@ class B { >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 4, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) constructor(x: T) { return null; } >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 5, 16)) @@ -16,7 +16,7 @@ class B { class C { >C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 8, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) constructor(x: T) { return null; } >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 9, 16)) @@ -26,12 +26,12 @@ class C { interface I { >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 12, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) new(x: T): Date; >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 13, 8)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 12, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } interface I2 { @@ -39,7 +39,7 @@ interface I2 { new(x: T): RegExp; >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 24)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 17, 8)) >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) @@ -48,7 +48,7 @@ interface I2 { var a: { new(x: T): T } >a : Symbol(a, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 3)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 29)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 20, 13)) @@ -57,7 +57,7 @@ var b = { new(x: T) { return null; } }; // not a construct signa >b : Symbol(b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 3)) >new : Symbol(new, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 9)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 30)) >T : Symbol(T, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 14)) @@ -65,13 +65,13 @@ function foo1b(x: B); >foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 15)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo1b(x: B); // error >foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 15)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo1b(x: any) { } >foo1b : Symbol(foo1b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 21, 55), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 23, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 24, 27)) @@ -81,13 +81,13 @@ function foo1c(x: C); >foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo1c(x: C); // error >foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo1c(x: any) { } >foo1c : Symbol(foo1c, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 25, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 27, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 28, 27)) @@ -97,13 +97,13 @@ function foo2(x: I); >foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo2(x: I); // error >foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo2(x: any) { } >foo2 : Symbol(foo2, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 29, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 31, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 32, 26)) @@ -141,13 +141,13 @@ function foo8(x: B); >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 14)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo8(x: I); // ok >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo8(x: any) { } >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 41, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 43, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 44, 26)) @@ -157,13 +157,13 @@ function foo9(x: B); >foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 14)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo9(x: C); // error since types are structurally equal >foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 14)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo9(x: any) { } >foo9 : Symbol(foo9, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 45, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 47, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 48, 26)) @@ -173,7 +173,7 @@ function foo10(x: B); >foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 15)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo10(x: typeof a); // ok >foo10 : Symbol(foo10, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 49, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 51, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 52, 28)) @@ -188,7 +188,7 @@ function foo11(x: B); >foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 15)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo11(x: typeof b); // ok >foo11 : Symbol(foo11, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 53, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 55, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 56, 28)) @@ -203,13 +203,13 @@ function foo12(x: I); >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12(x: C); // ok >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12(x: any) { } >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 57, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 59, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 60, 27)) @@ -224,7 +224,7 @@ function foo12b(x: C); // ok >foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 16)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12b(x: any) { } >foo12b : Symbol(foo12b, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 61, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 63, 23), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 64, 28)) @@ -234,7 +234,7 @@ function foo13(x: I); >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo13(x: typeof a); // ok >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 65, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 67, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 68, 28)) @@ -249,7 +249,7 @@ function foo14(x: I); >foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 10, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo14(x: typeof b); // ok >foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 69, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 71, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 72, 28)) @@ -269,7 +269,7 @@ function foo15(x: C); // ok >foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 27)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 6, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo15(x: any) { } >foo15 : Symbol(foo15, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 73, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 75, 22), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.ts, 76, 27)) diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols index e03c24b2ce5a1..605049ca01582 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.symbols @@ -159,7 +159,7 @@ function foo8(x: I); // BUG 832086 >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 51)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 14)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo8(x: any) { } >foo8 : Symbol(foo8, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 39, 25), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 41, 36), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 42, 51)) @@ -213,14 +213,14 @@ function foo12(x: I, number, Date, string>); >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12(x: C, number, Date>); // ok >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 62), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 54)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 15)) >C : Symbol(C, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 4, 1)) >B : Symbol(B, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo12(x: any) { } >foo12 : Symbol(foo12, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 55, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 57, 62), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 58, 54)) @@ -244,9 +244,9 @@ function foo13(x: I); >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo13(x: typeof a); // ok >foo13 : Symbol(foo13, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 63, 27), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 65, 49), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 66, 28)) @@ -261,7 +261,7 @@ function foo14(x: I); >foo14 : Symbol(foo14, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 67, 26), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 52), Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 70, 28)) >x : Symbol(x, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 69, 15)) >I : Symbol(I, Decl(objectTypesIdentityWithGenericConstructSignaturesDifferingTypeParameterCounts.ts, 8, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo14(x: typeof b); // ok diff --git a/tests/baselines/reference/overloadOnGenericArity.symbols b/tests/baselines/reference/overloadOnGenericArity.symbols index a50a788b4e847..3a56861cb7ffc 100644 --- a/tests/baselines/reference/overloadOnGenericArity.symbols +++ b/tests/baselines/reference/overloadOnGenericArity.symbols @@ -10,7 +10,7 @@ interface Test { then(p: string): Date; // Error: Overloads cannot differ only by return type >then : Symbol(Test.then, Decl(overloadOnGenericArity.ts, 0, 16), Decl(overloadOnGenericArity.ts, 1, 31)) >p : Symbol(p, Decl(overloadOnGenericArity.ts, 2, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/overloadResolution.symbols b/tests/baselines/reference/overloadResolution.symbols index a9e150c1a23a6..096d6991644da 100644 --- a/tests/baselines/reference/overloadResolution.symbols +++ b/tests/baselines/reference/overloadResolution.symbols @@ -77,12 +77,12 @@ function fn2() { return undefined; } var d = fn2(0, undefined); >d : Symbol(d, Decl(overloadResolution.ts, 33, 3), Decl(overloadResolution.ts, 34, 3)) >fn2 : Symbol(fn2, Decl(overloadResolution.ts, 26, 8), Decl(overloadResolution.ts, 29, 43), Decl(overloadResolution.ts, 30, 36)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) var d: Date; >d : Symbol(d, Decl(overloadResolution.ts, 33, 3), Decl(overloadResolution.ts, 34, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Generic and non - generic overload where generic overload is the only candidate when called without type arguments var s = fn2(0, ''); @@ -92,7 +92,7 @@ var s = fn2(0, ''); // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments fn2('', 0); // Error >fn2 : Symbol(fn2, Decl(overloadResolution.ts, 26, 8), Decl(overloadResolution.ts, 29, 43), Decl(overloadResolution.ts, 30, 36)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments fn2('', 0); // OK @@ -214,7 +214,7 @@ fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints fn4(null, null); // Error >fn4 : Symbol(fn4, Decl(overloadResolution.ts, 62, 38), Decl(overloadResolution.ts, 65, 61), Decl(overloadResolution.ts, 66, 61)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints fn4(true, null); // Error diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.symbols b/tests/baselines/reference/overloadResolutionClassConstructors.symbols index 469529e186d7a..193ca469bab95 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.symbols +++ b/tests/baselines/reference/overloadResolutionClassConstructors.symbols @@ -72,7 +72,7 @@ class fn2 { var d = new fn2(0, undefined); >d : Symbol(d, Decl(overloadResolutionClassConstructors.ts, 35, 3)) >fn2 : Symbol(fn2, Decl(overloadResolutionClassConstructors.ts, 26, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) // Generic and non - generic overload where generic overload is the only candidate when called without type arguments @@ -83,7 +83,7 @@ var s = new fn2(0, ''); // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments new fn2('', 0); // OK >fn2 : Symbol(fn2, Decl(overloadResolutionClassConstructors.ts, 26, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments new fn2('', 0); // OK @@ -184,7 +184,7 @@ new fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints new fn4(null, null); // Error >fn4 : Symbol(fn4, Decl(overloadResolutionClassConstructors.ts, 64, 42)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error diff --git a/tests/baselines/reference/overloadResolutionConstructors.symbols b/tests/baselines/reference/overloadResolutionConstructors.symbols index 1703e4060c3bd..0c9f9b413aa0e 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.symbols +++ b/tests/baselines/reference/overloadResolutionConstructors.symbols @@ -78,12 +78,12 @@ var fn2: fn2; var d = new fn2(0, undefined); >d : Symbol(d, Decl(overloadResolutionConstructors.ts, 35, 3), Decl(overloadResolutionConstructors.ts, 36, 3)) >fn2 : Symbol(fn2, Decl(overloadResolutionConstructors.ts, 26, 12), Decl(overloadResolutionConstructors.ts, 33, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) var d: Date; >d : Symbol(d, Decl(overloadResolutionConstructors.ts, 35, 3), Decl(overloadResolutionConstructors.ts, 36, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Generic and non - generic overload where generic overload is the only candidate when called without type arguments var s = new fn2(0, ''); @@ -93,7 +93,7 @@ var s = new fn2(0, ''); // Generic and non - generic overload where non - generic overload is the only candidate when called with type arguments new fn2('', 0); // Error >fn2 : Symbol(fn2, Decl(overloadResolutionConstructors.ts, 26, 12), Decl(overloadResolutionConstructors.ts, 33, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Generic and non - generic overload where non - generic overload is the only candidate when called without type arguments new fn2('', 0); // OK @@ -218,7 +218,7 @@ new fn4('', null); // Generic overloads with constraints called with type arguments that do not satisfy the constraints new fn4(null, null); // Error >fn4 : Symbol(fn4, Decl(overloadResolutionConstructors.ts, 66, 42), Decl(overloadResolutionConstructors.ts, 73, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) // Generic overloads with constraints called without type arguments but with types that do not satisfy the constraints new fn4(true, null); // Error diff --git a/tests/baselines/reference/parenthesizedContexualTyping3.symbols b/tests/baselines/reference/parenthesizedContexualTyping3.symbols index 25ef572e230e5..b74efeb1f53d5 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping3.symbols +++ b/tests/baselines/reference/parenthesizedContexualTyping3.symbols @@ -8,7 +8,7 @@ function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T; >tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 5, 77), Decl(parenthesizedContexualTyping3.ts, 6, 93)) >T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 5, 17)) >tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 5, 20)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 5, 51)) >x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 5, 56)) >T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 5, 17)) @@ -21,7 +21,7 @@ function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, h: (y: T) => >tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 5, 77), Decl(parenthesizedContexualTyping3.ts, 6, 93)) >T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) >tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 6, 20)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 6, 51)) >x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 6, 56)) >T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 6, 17)) @@ -38,7 +38,7 @@ function tempFun(tempStrs: TemplateStringsArray, g: (x: T) => T, x: T): T { >tempFun : Symbol(tempFun, Decl(parenthesizedContexualTyping3.ts, 0, 0), Decl(parenthesizedContexualTyping3.ts, 5, 77), Decl(parenthesizedContexualTyping3.ts, 6, 93)) >T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) >tempStrs : Symbol(tempStrs, Decl(parenthesizedContexualTyping3.ts, 7, 20)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >g : Symbol(g, Decl(parenthesizedContexualTyping3.ts, 7, 51)) >x : Symbol(x, Decl(parenthesizedContexualTyping3.ts, 7, 56)) >T : Symbol(T, Decl(parenthesizedContexualTyping3.ts, 7, 17)) diff --git a/tests/baselines/reference/parserArgumentList1.errors.txt b/tests/baselines/reference/parserArgumentList1.errors.txt index f01dfb531f00b..81eaadefa69fc 100644 --- a/tests/baselines/reference/parserArgumentList1.errors.txt +++ b/tests/baselines/reference/parserArgumentList1.errors.txt @@ -1,11 +1,8 @@ -tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(1,35): error TS2304: Cannot find name 'HTMLElement'. tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(2,42): error TS2304: Cannot find name '_classNameRegexp'. -==== tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts (1 errors) ==== export function removeClass (node:HTMLElement, className:string) { - ~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'HTMLElement'. node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { ~~~~~~~~~~~~~~~~ !!! error TS2304: Cannot find name '_classNameRegexp'. diff --git a/tests/baselines/reference/parserArgumentList1.symbols b/tests/baselines/reference/parserArgumentList1.symbols index b26819eb2df1c..2b6bd9ae22246 100644 --- a/tests/baselines/reference/parserArgumentList1.symbols +++ b/tests/baselines/reference/parserArgumentList1.symbols @@ -2,11 +2,18 @@ export function removeClass (node:HTMLElement, className:string) { >removeClass : Symbol(removeClass, Decl(parserArgumentList1.ts, 0, 0)) >node : Symbol(node, Decl(parserArgumentList1.ts, 0, 29)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >className : Symbol(className, Decl(parserArgumentList1.ts, 0, 46)) node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { +>node.className : Symbol(Element.className, Decl(lib.d.ts, --, --)) >node : Symbol(node, Decl(parserArgumentList1.ts, 0, 29)) +>className : Symbol(Element.className, Decl(lib.d.ts, --, --)) +>node.className.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>node.className : Symbol(Element.className, Decl(lib.d.ts, --, --)) >node : Symbol(node, Decl(parserArgumentList1.ts, 0, 29)) +>className : Symbol(Element.className, Decl(lib.d.ts, --, --)) +>replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >className : Symbol(className, Decl(parserArgumentList1.ts, 0, 46)) >everything : Symbol(everything, Decl(parserArgumentList1.ts, 1, 80)) >leftDelimiter : Symbol(leftDelimiter, Decl(parserArgumentList1.ts, 1, 91)) diff --git a/tests/baselines/reference/parserArgumentList1.types b/tests/baselines/reference/parserArgumentList1.types index e3e386d689f11..ddf00ee8750da 100644 --- a/tests/baselines/reference/parserArgumentList1.types +++ b/tests/baselines/reference/parserArgumentList1.types @@ -1,26 +1,26 @@ === tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts === export function removeClass (node:HTMLElement, className:string) { ->removeClass : (node: any, className: string) => void ->node : any ->HTMLElement : No type information available! +>removeClass : (node: HTMLElement, className: string) => void +>node : HTMLElement +>HTMLElement : HTMLElement >className : string node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { ->node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; }) : any ->node.className : any ->node : any ->className : any ->node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; }) : any ->node.className.replace : any ->node.className : any ->node : any ->className : any ->replace : any +>node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; }) : string +>node.className : string +>node : HTMLElement +>className : string +>node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) { return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; }) : string +>node.className.replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; } +>node.className : string +>node : HTMLElement +>className : string +>replace : { (searchValue: string | RegExp, replaceValue: string): string; (searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string; } >_classNameRegexp(className) : any >_classNameRegexp : any >className : string ->function (everything, leftDelimiter, name, rightDelimiter) { return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; } : (everything: any, leftDelimiter: any, name: any, rightDelimiter: any) => " " | "" ->everything : any +>function (everything, leftDelimiter, name, rightDelimiter) { return leftDelimiter.length + rightDelimiter.length === 2 ? ' ' : ''; } : (everything: string, leftDelimiter: any, name: any, rightDelimiter: any) => " " | "" +>everything : string >leftDelimiter : any >name : any >rightDelimiter : any diff --git a/tests/baselines/reference/parserConstructorAmbiguity1.symbols b/tests/baselines/reference/parserConstructorAmbiguity1.symbols index b57d027542a2c..60044726e9f4f 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity1.symbols +++ b/tests/baselines/reference/parserConstructorAmbiguity1.symbols @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity1.ts === new DateDate : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/parserConstructorAmbiguity2.symbols b/tests/baselines/reference/parserConstructorAmbiguity2.symbols index 1dee1297cf91f..d53f5628106b5 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity2.symbols +++ b/tests/baselines/reference/parserConstructorAmbiguity2.symbols @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity2.ts === new DateDate : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/parserConstructorAmbiguity3.symbols b/tests/baselines/reference/parserConstructorAmbiguity3.symbols index 914a5367f7e6d..9c76818ebf217 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity3.symbols +++ b/tests/baselines/reference/parserConstructorAmbiguity3.symbols @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity3.ts === new Date ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/parserConstructorAmbiguity4.symbols b/tests/baselines/reference/parserConstructorAmbiguity4.symbols index d080b257e5af8..69449eb070a31 100644 --- a/tests/baselines/reference/parserConstructorAmbiguity4.symbols +++ b/tests/baselines/reference/parserConstructorAmbiguity4.symbols @@ -1,4 +1,4 @@ === tests/cases/conformance/parser/ecmascript5/Generics/parserConstructorAmbiguity4.ts === new DateDate : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/parserInExpression1.errors.txt b/tests/baselines/reference/parserInExpression1.errors.txt deleted file mode 100644 index d0f9778b2947f..0000000000000 --- a/tests/baselines/reference/parserInExpression1.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/parserInExpression1.ts(1,1): error TS2304: Cannot find name 'console'. - - -==== tests/cases/conformance/parser/ecmascript5/parserInExpression1.ts (1 errors) ==== - console.log("a" in { "a": true }); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. \ No newline at end of file diff --git a/tests/baselines/reference/parserInExpression1.symbols b/tests/baselines/reference/parserInExpression1.symbols index c351905f2fde3..25c37cb3ed2a4 100644 --- a/tests/baselines/reference/parserInExpression1.symbols +++ b/tests/baselines/reference/parserInExpression1.symbols @@ -1,3 +1,6 @@ === tests/cases/conformance/parser/ecmascript5/parserInExpression1.ts === console.log("a" in { "a": true }); -No type information for this code. \ No newline at end of file +>console.log : Symbol(Console.log, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.d.ts, --, --)) + diff --git a/tests/baselines/reference/parserInExpression1.types b/tests/baselines/reference/parserInExpression1.types index 6461292147973..259d148c7984f 100644 --- a/tests/baselines/reference/parserInExpression1.types +++ b/tests/baselines/reference/parserInExpression1.types @@ -1,9 +1,9 @@ === tests/cases/conformance/parser/ecmascript5/parserInExpression1.ts === console.log("a" in { "a": true }); ->console.log("a" in { "a": true }) : any ->console.log : any ->console : any ->log : any +>console.log("a" in { "a": true }) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void >"a" in { "a": true } : boolean >"a" : "a" >{ "a": true } : { "a": boolean; } diff --git a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt index 36bd5b08e196b..f2d0117732013 100644 --- a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt +++ b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.errors.txt @@ -1,13 +1,10 @@ tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(1,9): error TS2554: Expected 0 arguments, but got 1. -tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts(2,7): error TS2304: Cannot find name 'window'. -==== tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/parserNoASIOnCallAfterFunctionExpression1.ts (1 errors) ==== var x = function () { } ~~~~~~~~~~~~~~~ (window).foo; ~~~~~~~~~~~~~ !!! error TS2554: Expected 0 arguments, but got 1. - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. \ No newline at end of file diff --git a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.symbols b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.symbols index a8e686cd7e303..b71c25b6b1560 100644 --- a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.symbols +++ b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.symbols @@ -3,4 +3,5 @@ var x = function () { } >x : Symbol(x, Decl(parserNoASIOnCallAfterFunctionExpression1.ts, 0, 3)) (window).foo; +>window : Symbol(window, Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.types b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.types index 083eb5f66e4a8..703107905e677 100644 --- a/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.types +++ b/tests/baselines/reference/parserNoASIOnCallAfterFunctionExpression1.types @@ -7,6 +7,6 @@ var x = function () { } (window).foo; >window : any ->window : any +>window : Window >foo : any diff --git a/tests/baselines/reference/parserNotHexLiteral1.errors.txt b/tests/baselines/reference/parserNotHexLiteral1.errors.txt deleted file mode 100644 index 7c0cbf6f6042d..0000000000000 --- a/tests/baselines/reference/parserNotHexLiteral1.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/RegressionTests/parserNotHexLiteral1.ts(2,1): error TS2304: Cannot find name 'console'. -tests/cases/conformance/parser/ecmascript5/RegressionTests/parserNotHexLiteral1.ts(5,1): error TS2304: Cannot find name 'console'. - - -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserNotHexLiteral1.ts (2 errors) ==== - var x = {e0: 'cat', x0: 'dog'}; - console.info (x.x0); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - // tsc dies on this next line with "bug.ts (5,16): Expected ')'" - // tsc seems to be parsing the e0 as a hex constant. - console.info (x.e0); - ~~~~~~~ -!!! error TS2304: Cannot find name 'console'. - \ No newline at end of file diff --git a/tests/baselines/reference/parserNotHexLiteral1.symbols b/tests/baselines/reference/parserNotHexLiteral1.symbols index 3070cd1db7c0d..f664a95fbf0be 100644 --- a/tests/baselines/reference/parserNotHexLiteral1.symbols +++ b/tests/baselines/reference/parserNotHexLiteral1.symbols @@ -5,6 +5,9 @@ var x = {e0: 'cat', x0: 'dog'}; >x0 : Symbol(x0, Decl(parserNotHexLiteral1.ts, 0, 19)) console.info (x.x0); +>console.info : Symbol(Console.info, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>info : Symbol(Console.info, Decl(lib.d.ts, --, --)) >x.x0 : Symbol(x0, Decl(parserNotHexLiteral1.ts, 0, 19)) >x : Symbol(x, Decl(parserNotHexLiteral1.ts, 0, 3)) >x0 : Symbol(x0, Decl(parserNotHexLiteral1.ts, 0, 19)) @@ -12,6 +15,9 @@ console.info (x.x0); // tsc dies on this next line with "bug.ts (5,16): Expected ')'" // tsc seems to be parsing the e0 as a hex constant. console.info (x.e0); +>console.info : Symbol(Console.info, Decl(lib.d.ts, --, --)) +>console : Symbol(console, Decl(lib.d.ts, --, --)) +>info : Symbol(Console.info, Decl(lib.d.ts, --, --)) >x.e0 : Symbol(e0, Decl(parserNotHexLiteral1.ts, 0, 9)) >x : Symbol(x, Decl(parserNotHexLiteral1.ts, 0, 3)) >e0 : Symbol(e0, Decl(parserNotHexLiteral1.ts, 0, 9)) diff --git a/tests/baselines/reference/parserNotHexLiteral1.types b/tests/baselines/reference/parserNotHexLiteral1.types index 619221a0cc523..4ec11682de3a8 100644 --- a/tests/baselines/reference/parserNotHexLiteral1.types +++ b/tests/baselines/reference/parserNotHexLiteral1.types @@ -8,10 +8,10 @@ var x = {e0: 'cat', x0: 'dog'}; >'dog' : "dog" console.info (x.x0); ->console.info (x.x0) : any ->console.info : any ->console : any ->info : any +>console.info (x.x0) : void +>console.info : (message?: any, ...optionalParams: any[]) => void +>console : Console +>info : (message?: any, ...optionalParams: any[]) => void >x.x0 : string >x : { e0: string; x0: string; } >x0 : string @@ -19,10 +19,10 @@ console.info (x.x0); // tsc dies on this next line with "bug.ts (5,16): Expected ')'" // tsc seems to be parsing the e0 as a hex constant. console.info (x.e0); ->console.info (x.e0) : any ->console.info : any ->console : any ->info : any +>console.info (x.e0) : void +>console.info : (message?: any, ...optionalParams: any[]) => void +>console : Console +>info : (message?: any, ...optionalParams: any[]) => void >x.e0 : string >x : { e0: string; x0: string; } >e0 : string diff --git a/tests/baselines/reference/parserOverloadOnConstants1.errors.txt b/tests/baselines/reference/parserOverloadOnConstants1.errors.txt deleted file mode 100644 index 465e29bd79897..0000000000000 --- a/tests/baselines/reference/parserOverloadOnConstants1.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts(2,37): error TS2304: Cannot find name 'HTMLElement'. -tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts(3,39): error TS2304: Cannot find name 'HTMLCanvasElement'. -tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts(4,36): error TS2304: Cannot find name 'HTMLDivElement'. -tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts(5,37): error TS2304: Cannot find name 'HTMLSpanElement'. - - -==== tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts (4 errors) ==== - interface Document { - createElement(tagName: string): HTMLElement; - ~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'HTMLElement'. - createElement(tagName: 'canvas'): HTMLCanvasElement; - ~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'HTMLCanvasElement'. - createElement(tagName: 'div'): HTMLDivElement; - ~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'HTMLDivElement'. - createElement(tagName: 'span'): HTMLSpanElement; - ~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'HTMLSpanElement'. - } \ No newline at end of file diff --git a/tests/baselines/reference/parserOverloadOnConstants1.symbols b/tests/baselines/reference/parserOverloadOnConstants1.symbols index 4b6209cc83e89..7105f32e5ec6a 100644 --- a/tests/baselines/reference/parserOverloadOnConstants1.symbols +++ b/tests/baselines/reference/parserOverloadOnConstants1.symbols @@ -1,20 +1,24 @@ === tests/cases/conformance/parser/ecmascript5/parserOverloadOnConstants1.ts === interface Document { ->Document : Symbol(Document, Decl(parserOverloadOnConstants1.ts, 0, 0)) +>Document : Symbol(Document, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(parserOverloadOnConstants1.ts, 0, 0)) createElement(tagName: string): HTMLElement; ->createElement : Symbol(Document.createElement, Decl(parserOverloadOnConstants1.ts, 0, 20), Decl(parserOverloadOnConstants1.ts, 1, 48), Decl(parserOverloadOnConstants1.ts, 2, 56), Decl(parserOverloadOnConstants1.ts, 3, 50)) +>createElement : Symbol(Document.createElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(parserOverloadOnConstants1.ts, 0, 20), Decl(parserOverloadOnConstants1.ts, 1, 48), Decl(parserOverloadOnConstants1.ts, 2, 56) ... and 1 more) >tagName : Symbol(tagName, Decl(parserOverloadOnConstants1.ts, 1, 18)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) createElement(tagName: 'canvas'): HTMLCanvasElement; ->createElement : Symbol(Document.createElement, Decl(parserOverloadOnConstants1.ts, 0, 20), Decl(parserOverloadOnConstants1.ts, 1, 48), Decl(parserOverloadOnConstants1.ts, 2, 56), Decl(parserOverloadOnConstants1.ts, 3, 50)) +>createElement : Symbol(Document.createElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(parserOverloadOnConstants1.ts, 0, 20), Decl(parserOverloadOnConstants1.ts, 1, 48), Decl(parserOverloadOnConstants1.ts, 2, 56) ... and 1 more) >tagName : Symbol(tagName, Decl(parserOverloadOnConstants1.ts, 2, 18)) +>HTMLCanvasElement : Symbol(HTMLCanvasElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) createElement(tagName: 'div'): HTMLDivElement; ->createElement : Symbol(Document.createElement, Decl(parserOverloadOnConstants1.ts, 0, 20), Decl(parserOverloadOnConstants1.ts, 1, 48), Decl(parserOverloadOnConstants1.ts, 2, 56), Decl(parserOverloadOnConstants1.ts, 3, 50)) +>createElement : Symbol(Document.createElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(parserOverloadOnConstants1.ts, 0, 20), Decl(parserOverloadOnConstants1.ts, 1, 48), Decl(parserOverloadOnConstants1.ts, 2, 56) ... and 1 more) >tagName : Symbol(tagName, Decl(parserOverloadOnConstants1.ts, 3, 18)) +>HTMLDivElement : Symbol(HTMLDivElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) createElement(tagName: 'span'): HTMLSpanElement; ->createElement : Symbol(Document.createElement, Decl(parserOverloadOnConstants1.ts, 0, 20), Decl(parserOverloadOnConstants1.ts, 1, 48), Decl(parserOverloadOnConstants1.ts, 2, 56), Decl(parserOverloadOnConstants1.ts, 3, 50)) +>createElement : Symbol(Document.createElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(parserOverloadOnConstants1.ts, 0, 20), Decl(parserOverloadOnConstants1.ts, 1, 48), Decl(parserOverloadOnConstants1.ts, 2, 56) ... and 1 more) >tagName : Symbol(tagName, Decl(parserOverloadOnConstants1.ts, 4, 18)) +>HTMLSpanElement : Symbol(HTMLSpanElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserOverloadOnConstants1.types b/tests/baselines/reference/parserOverloadOnConstants1.types index e62c5ef3b2819..3d972850bc106 100644 --- a/tests/baselines/reference/parserOverloadOnConstants1.types +++ b/tests/baselines/reference/parserOverloadOnConstants1.types @@ -3,22 +3,22 @@ interface Document { >Document : Document createElement(tagName: string): HTMLElement; ->createElement : { (tagName: string): any; (tagName: "canvas"): any; (tagName: "div"): any; (tagName: "span"): any; } +>createElement : { (tagName: K): HTMLElementTagNameMap[K]; (tagName: string): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : string ->HTMLElement : No type information available! +>HTMLElement : HTMLElement createElement(tagName: 'canvas'): HTMLCanvasElement; ->createElement : { (tagName: string): any; (tagName: "canvas"): any; (tagName: "div"): any; (tagName: "span"): any; } +>createElement : { (tagName: K): HTMLElementTagNameMap[K]; (tagName: string): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : "canvas" ->HTMLCanvasElement : No type information available! +>HTMLCanvasElement : HTMLCanvasElement createElement(tagName: 'div'): HTMLDivElement; ->createElement : { (tagName: string): any; (tagName: "canvas"): any; (tagName: "div"): any; (tagName: "span"): any; } +>createElement : { (tagName: K): HTMLElementTagNameMap[K]; (tagName: string): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : "div" ->HTMLDivElement : No type information available! +>HTMLDivElement : HTMLDivElement createElement(tagName: 'span'): HTMLSpanElement; ->createElement : { (tagName: string): any; (tagName: "canvas"): any; (tagName: "div"): any; (tagName: "span"): any; } +>createElement : { (tagName: K): HTMLElementTagNameMap[K]; (tagName: string): HTMLElement; (tagName: string): HTMLElement; (tagName: "canvas"): HTMLCanvasElement; (tagName: "div"): HTMLDivElement; (tagName: "span"): HTMLSpanElement; } >tagName : "span" ->HTMLSpanElement : No type information available! +>HTMLSpanElement : HTMLSpanElement } diff --git a/tests/baselines/reference/parserRealSource1.symbols b/tests/baselines/reference/parserRealSource1.symbols index 4b5cc378607e0..245d5082f0802 100644 --- a/tests/baselines/reference/parserRealSource1.symbols +++ b/tests/baselines/reference/parserRealSource1.symbols @@ -288,7 +288,7 @@ module TypeScript { var start = +new Date(); >start : Symbol(start, Decl(parserRealSource1.ts, 97, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var result = func(); >result : Symbol(result, Decl(parserRealSource1.ts, 98, 11)) @@ -296,7 +296,7 @@ module TypeScript { var end = +new Date(); >end : Symbol(end, Decl(parserRealSource1.ts, 99, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) logger.log(funcDescription + " completed in " + (end - start) + " msec"); >logger.log : Symbol(ILogger.log, Decl(parserRealSource1.ts, 43, 25)) diff --git a/tests/baselines/reference/parserRealSource5.symbols b/tests/baselines/reference/parserRealSource5.symbols index 5feaa2b7b4c42..2cdc694da6217 100644 --- a/tests/baselines/reference/parserRealSource5.symbols +++ b/tests/baselines/reference/parserRealSource5.symbols @@ -50,11 +50,11 @@ module TypeScript { >startLine : Symbol(PrintContext.startLine, Decl(parserRealSource5.ts, 22, 9)) if (this.builder.length > 0) { ->this.builder.length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>this.builder.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >this.builder : Symbol(PrintContext.builder, Decl(parserRealSource5.ts, 7, 31)) >this : Symbol(PrintContext, Decl(parserRealSource5.ts, 5, 19)) >builder : Symbol(PrintContext.builder, Decl(parserRealSource5.ts, 7, 31)) ->length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) CompilerDiagnostics.Alert(this.builder); >this.builder : Symbol(PrintContext.builder, Decl(parserRealSource5.ts, 7, 31)) diff --git a/tests/baselines/reference/parserSymbolProperty1.symbols b/tests/baselines/reference/parserSymbolProperty1.symbols index 4622f37a0e451..5fa1c93f8463b 100644 --- a/tests/baselines/reference/parserSymbolProperty1.symbols +++ b/tests/baselines/reference/parserSymbolProperty1.symbols @@ -3,7 +3,7 @@ interface I { >I : Symbol(I, Decl(parserSymbolProperty1.ts, 0, 0)) [Symbol.iterator]: string; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserSymbolProperty2.symbols b/tests/baselines/reference/parserSymbolProperty2.symbols index f5bb7fa0f532d..b8c2f11868797 100644 --- a/tests/baselines/reference/parserSymbolProperty2.symbols +++ b/tests/baselines/reference/parserSymbolProperty2.symbols @@ -3,7 +3,7 @@ interface I { >I : Symbol(I, Decl(parserSymbolProperty2.ts, 0, 0)) [Symbol.unscopables](): string; ->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.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserSymbolProperty3.symbols b/tests/baselines/reference/parserSymbolProperty3.symbols index 9d2266ad4b7ee..233fc9d71c2ec 100644 --- a/tests/baselines/reference/parserSymbolProperty3.symbols +++ b/tests/baselines/reference/parserSymbolProperty3.symbols @@ -3,7 +3,7 @@ declare class C { >C : Symbol(C, Decl(parserSymbolProperty3.ts, 0, 0)) [Symbol.unscopables](): string; ->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.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserSymbolProperty4.symbols b/tests/baselines/reference/parserSymbolProperty4.symbols index e37cb6bc011b3..08875ac8b7569 100644 --- a/tests/baselines/reference/parserSymbolProperty4.symbols +++ b/tests/baselines/reference/parserSymbolProperty4.symbols @@ -3,7 +3,7 @@ declare class C { >C : Symbol(C, Decl(parserSymbolProperty4.ts, 0, 0)) [Symbol.toPrimitive]: string; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserSymbolProperty5.symbols b/tests/baselines/reference/parserSymbolProperty5.symbols index f8fb7d9341708..7551b5547f86a 100644 --- a/tests/baselines/reference/parserSymbolProperty5.symbols +++ b/tests/baselines/reference/parserSymbolProperty5.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty5.ts, 0, 0)) [Symbol.toPrimitive]: string; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserSymbolProperty6.symbols b/tests/baselines/reference/parserSymbolProperty6.symbols index 7fb83ea9ffac5..0dfddafce547f 100644 --- a/tests/baselines/reference/parserSymbolProperty6.symbols +++ b/tests/baselines/reference/parserSymbolProperty6.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty6.ts, 0, 0)) [Symbol.toStringTag]: string = ""; ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserSymbolProperty7.symbols b/tests/baselines/reference/parserSymbolProperty7.symbols index 8d71cbb1a0d91..9aa7f9f20d4d8 100644 --- a/tests/baselines/reference/parserSymbolProperty7.symbols +++ b/tests/baselines/reference/parserSymbolProperty7.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(parserSymbolProperty7.ts, 0, 0)) [Symbol.toStringTag](): void { } ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserSymbolProperty8.symbols b/tests/baselines/reference/parserSymbolProperty8.symbols index e20dd2dbba48d..4e04cd3ebd648 100644 --- a/tests/baselines/reference/parserSymbolProperty8.symbols +++ b/tests/baselines/reference/parserSymbolProperty8.symbols @@ -3,7 +3,7 @@ var x: { >x : Symbol(x, Decl(parserSymbolProperty8.ts, 0, 3)) [Symbol.toPrimitive](): string ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserSymbolProperty9.symbols b/tests/baselines/reference/parserSymbolProperty9.symbols index c70643c254a3e..b03830079446b 100644 --- a/tests/baselines/reference/parserSymbolProperty9.symbols +++ b/tests/baselines/reference/parserSymbolProperty9.symbols @@ -3,7 +3,7 @@ var x: { >x : Symbol(x, Decl(parserSymbolProperty9.ts, 0, 3)) [Symbol.toPrimitive]: string ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/parserharness.symbols b/tests/baselines/reference/parserharness.symbols index 8382d6ab41ab2..85fcd37d626ee 100644 --- a/tests/baselines/reference/parserharness.symbols +++ b/tests/baselines/reference/parserharness.symbols @@ -43,9 +43,9 @@ function switchToForwardSlashes(path: string) { >path : Symbol(path, Decl(parserharness.ts, 27, 32)) return path.replace(/\\/g, "/"); ->path.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>path.replace : Symbol(String.replace, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >path : Symbol(path, Decl(parserharness.ts, 27, 32)) ->replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>replace : Symbol(String.replace, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } function filePath(fullPath: string) { @@ -59,23 +59,23 @@ function filePath(fullPath: string) { var components = fullPath.split("/"); >components : Symbol(components, Decl(parserharness.ts, 33, 7)) ->fullPath.split : Symbol(String.split, Decl(lib.d.ts, --, --)) +>fullPath.split : Symbol(String.split, Decl(lib.es5.d.ts, --, --)) >fullPath : Symbol(fullPath, Decl(parserharness.ts, 31, 18)) ->split : Symbol(String.split, Decl(lib.d.ts, --, --)) +>split : Symbol(String.split, Decl(lib.es5.d.ts, --, --)) var path: string[] = components.slice(0, components.length - 1); >path : Symbol(path, Decl(parserharness.ts, 34, 7)) ->components.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>components.slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) >components : Symbol(components, Decl(parserharness.ts, 33, 7)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) ->components.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) +>components.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >components : Symbol(components, Decl(parserharness.ts, 33, 7)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) return path.join("/") + "/"; ->path.join : Symbol(Array.join, Decl(lib.d.ts, --, --)) +>path.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) >path : Symbol(path, Decl(parserharness.ts, 34, 7)) ->join : Symbol(Array.join, Decl(lib.d.ts, --, --)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) } var typescriptServiceFileName = filePath(IO.getExecutingFilePath()) + "typescriptServices.js"; @@ -90,7 +90,7 @@ var typescriptServiceFile = IO.readFile(typescriptServiceFileName); if (typeof ActiveXObject === "function") { eval(typescriptServiceFile); ->eval : Symbol(eval, Decl(lib.d.ts, --, --)) +>eval : Symbol(eval, Decl(lib.es5.d.ts, --, --)) >typescriptServiceFile : Symbol(typescriptServiceFile, Decl(parserharness.ts, 39, 3)) } else if (typeof require === "function") { @@ -103,7 +103,7 @@ if (typeof ActiveXObject === "function") { } else { throw new Error('Unknown context'); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } declare module process { @@ -117,7 +117,7 @@ declare module process { >on : Symbol(on, Decl(parserharness.ts, 50, 56)) >event : Symbol(event, Decl(parserharness.ts, 51, 23)) >listener : Symbol(listener, Decl(parserharness.ts, 51, 37)) ->Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } module Harness { @@ -129,9 +129,9 @@ module Harness { var global = Function("return this").call(null); >global : Symbol(global, Decl(parserharness.ts, 57, 7)) ->Function("return this").call : Symbol(Function.call, Decl(lib.d.ts, --, --)) ->Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->call : Symbol(Function.call, Decl(lib.d.ts, --, --)) +>Function("return this").call : Symbol(Function.call, Decl(lib.es5.d.ts, --, --)) +>Function : Symbol(Function, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>call : Symbol(Function.call, Decl(lib.es5.d.ts, --, --)) export var usePull = false; >usePull : Symbol(usePull, Decl(parserharness.ts, 58, 14)) @@ -194,7 +194,7 @@ module Harness { export var throwAssertError = (error: Error) => { >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) >error : Symbol(error, Decl(parserharness.ts, 82, 39)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) throw error; >error : Symbol(error, Decl(parserharness.ts, 82, 39)) @@ -207,15 +207,15 @@ module Harness { >id : Symbol(id, Decl(parserharness.ts, 87, 28)) if (bugIds.indexOf(id) < 0) { ->bugIds.indexOf : Symbol(Array.indexOf, Decl(lib.d.ts, --, --)) +>bugIds.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) >bugIds : Symbol(bugIds, Decl(parserharness.ts, 81, 18)) ->indexOf : Symbol(Array.indexOf, Decl(lib.d.ts, --, --)) +>indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) >id : Symbol(id, Decl(parserharness.ts, 87, 28)) bugIds.push(id); ->bugIds.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>bugIds.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >bugIds : Symbol(bugIds, Decl(parserharness.ts, 81, 18)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >id : Symbol(id, Decl(parserharness.ts, 87, 28)) } } @@ -227,17 +227,17 @@ module Harness { var bugs = content.match(/\bbug (\d+)/i); >bugs : Symbol(bugs, Decl(parserharness.ts, 95, 15)) ->content.match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>content.match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) >content : Symbol(content, Decl(parserharness.ts, 94, 29)) ->match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) if (bugs) { >bugs : Symbol(bugs, Decl(parserharness.ts, 95, 15)) bugs.forEach(bug => assert.bug(bug)); ->bugs.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>bugs.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >bugs : Symbol(bugs, Decl(parserharness.ts, 95, 15)) ->forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >bug : Symbol(bug, Decl(parserharness.ts, 97, 29)) >assert : Symbol(assert, Decl(parserharness.ts, 20, 11)) >bug : Symbol(bug, Decl(parserharness.ts, 97, 29)) @@ -254,7 +254,7 @@ module Harness { throwAssertError(new Error(msg || "Expected true, got false.")); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >msg : Symbol(msg, Decl(parserharness.ts, 101, 43)) } } @@ -265,18 +265,18 @@ module Harness { >length : Symbol(length, Decl(parserharness.ts, 107, 49)) if (arr.length != length) { ->arr.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>arr.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >arr : Symbol(arr, Decl(parserharness.ts, 107, 38)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >length : Symbol(length, Decl(parserharness.ts, 107, 49)) var actual = ''; >actual : Symbol(actual, Decl(parserharness.ts, 109, 19)) arr.forEach(n => actual = actual + '\n ' + n.toString()); ->arr.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>arr.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >arr : Symbol(arr, Decl(parserharness.ts, 107, 38)) ->forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >n : Symbol(n, Decl(parserharness.ts, 110, 28)) >actual : Symbol(actual, Decl(parserharness.ts, 109, 19)) >actual : Symbol(actual, Decl(parserharness.ts, 109, 19)) @@ -284,7 +284,7 @@ module Harness { throwAssertError(new Error('Expected array to have ' + length + ' elements. Actual elements were:' + actual)); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >length : Symbol(length, Decl(parserharness.ts, 107, 49)) >actual : Symbol(actual, Decl(parserharness.ts, 109, 19)) } @@ -301,7 +301,7 @@ module Harness { throwAssertError(new Error("Expected " + actual + " to equal " + expected)); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >actual : Symbol(actual, Decl(parserharness.ts, 115, 30)) >expected : Symbol(expected, Decl(parserharness.ts, 115, 37)) } @@ -318,7 +318,7 @@ module Harness { throwAssertError(new Error("Expected " + actual + " to *not* equal " + expected)); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >actual : Symbol(actual, Decl(parserharness.ts, 121, 33)) >expected : Symbol(expected, Decl(parserharness.ts, 121, 40)) } @@ -333,7 +333,7 @@ module Harness { throwAssertError(new Error("Expected " + result + " to *not* be null")); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 127, 32)) } } @@ -359,11 +359,11 @@ module Harness { >actual : Symbol(actual, Decl(parserharness.ts, 135, 19)) result.errors.forEach(err => { ->result.errors.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>result.errors.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >result.errors : Symbol(Compiler.CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) >result : Symbol(result, Decl(parserharness.ts, 133, 40)) >errors : Symbol(Compiler.CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) ->forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >err : Symbol(err, Decl(parserharness.ts, 136, 38)) actual = actual + '\n ' + err.toString(); @@ -377,7 +377,7 @@ module Harness { throwAssertError(new Error("Expected compiler warning at (" + line + ", " + column + "): " + desc + "\nActual errors follow: " + actual)); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >line : Symbol(line, Decl(parserharness.ts, 133, 72)) >column : Symbol(column, Decl(parserharness.ts, 133, 86)) >desc : Symbol(desc, Decl(parserharness.ts, 133, 102)) @@ -442,7 +442,7 @@ module Harness { } throwAssertError(new Error(errorString)); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >errorString : Symbol(errorString, Decl(parserharness.ts, 149, 19)) } } @@ -458,9 +458,9 @@ module Harness { for (var i = 0; i < contains.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 166, 20)) >i : Symbol(i, Decl(parserharness.ts, 166, 20)) ->contains.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>contains.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >contains : Symbol(contains, Decl(parserharness.ts, 163, 49)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 166, 20)) found = false; @@ -469,9 +469,9 @@ module Harness { for (var j = 0; j < arr.length; j++) { >j : Symbol(j, Decl(parserharness.ts, 169, 24)) >j : Symbol(j, Decl(parserharness.ts, 169, 24)) ->arr.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>arr.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >arr : Symbol(arr, Decl(parserharness.ts, 163, 38)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >j : Symbol(j, Decl(parserharness.ts, 169, 24)) if (arr[j] === contains[i]) { @@ -492,7 +492,7 @@ module Harness { throwAssertError(new Error("Expected array to contain \"" + contains[i] + "\"")); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >contains : Symbol(contains, Decl(parserharness.ts, 163, 49)) >i : Symbol(i, Decl(parserharness.ts, 166, 20)) } @@ -511,9 +511,9 @@ module Harness { for (var i = 0; i < arr.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 185, 20)) >i : Symbol(i, Decl(parserharness.ts, 185, 20)) ->arr.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>arr.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >arr : Symbol(arr, Decl(parserharness.ts, 182, 42)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 185, 20)) if (filter(arr[i])) { @@ -531,7 +531,7 @@ module Harness { throwAssertError(new Error("Expected array to match element only once (instead of " + foundCount + " times)")); >throwAssertError : Symbol(throwAssertError, Decl(parserharness.ts, 82, 18)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foundCount : Symbol(foundCount, Decl(parserharness.ts, 183, 15)) } } @@ -547,20 +547,20 @@ module Harness { // we have to string-based splitting instead and try to figure out the delimiting chars var lines = content.split('\r\n'); >lines : Symbol(lines, Decl(parserharness.ts, 202, 11)) ->content.split : Symbol(String.split, Decl(lib.d.ts, --, --)) +>content.split : Symbol(String.split, Decl(lib.es5.d.ts, --, --)) >content : Symbol(content, Decl(parserharness.ts, 198, 43)) ->split : Symbol(String.split, Decl(lib.d.ts, --, --)) +>split : Symbol(String.split, Decl(lib.es5.d.ts, --, --)) if (lines.length === 1) { ->lines.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>lines.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >lines : Symbol(lines, Decl(parserharness.ts, 202, 11)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) lines = content.split('\n'); >lines : Symbol(lines, Decl(parserharness.ts, 202, 11)) ->content.split : Symbol(String.split, Decl(lib.d.ts, --, --)) +>content.split : Symbol(String.split, Decl(lib.es5.d.ts, --, --)) >content : Symbol(content, Decl(parserharness.ts, 198, 43)) ->split : Symbol(String.split, Decl(lib.d.ts, --, --)) +>split : Symbol(String.split, Decl(lib.es5.d.ts, --, --)) } return lines; >lines : Symbol(lines, Decl(parserharness.ts, 202, 11)) @@ -572,9 +572,9 @@ module Harness { >path : Symbol(path, Decl(parserharness.ts, 210, 29)) if (path.indexOf('tests') < 0) { ->path.indexOf : Symbol(String.indexOf, Decl(lib.d.ts, --, --)) +>path.indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --)) >path : Symbol(path, Decl(parserharness.ts, 210, 29)) ->indexOf : Symbol(String.indexOf, Decl(lib.d.ts, --, --)) +>indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --)) path = "tests/" + path; >path : Symbol(path, Decl(parserharness.ts, 210, 29)) @@ -593,7 +593,7 @@ module Harness { >content : Symbol(content, Decl(parserharness.ts, 216, 11)) throw new Error("failed to read file at: '" + Harness.userSpecifiedroot + path + "'"); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Harness.userSpecifiedroot : Symbol(userSpecifiedroot, Decl(parserharness.ts, 56, 14)) >Harness : Symbol(Harness, Decl(parserharness.ts, 52, 1)) >userSpecifiedroot : Symbol(userSpecifiedroot, Decl(parserharness.ts, 56, 14)) @@ -627,7 +627,7 @@ module Harness { >scenario : Symbol(scenario, Decl(parserharness.ts, 229, 22)) >IScenarioMetadata : Symbol(IScenarioMetadata, Decl(parserharness.ts, 71, 5)) >error : Symbol(error, Decl(parserharness.ts, 229, 50)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) testStart: (test: ITestMetadata) => void; >testStart : Symbol(ILogger.testStart, Decl(parserharness.ts, 229, 74)) @@ -654,7 +654,7 @@ module Harness { >test : Symbol(test, Decl(parserharness.ts, 234, 16)) >ITestMetadata : Symbol(ITestMetadata, Decl(parserharness.ts, 58, 31)) >error : Symbol(error, Decl(parserharness.ts, 234, 36)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) comment: (comment: string) => void; >comment : Symbol(ILogger.comment, Decl(parserharness.ts, 234, 59)) @@ -693,7 +693,7 @@ module Harness { >scenario : Symbol(scenario, Decl(parserharness.ts, 243, 27)) >IScenarioMetadata : Symbol(IScenarioMetadata, Decl(parserharness.ts, 71, 5)) >error : Symbol(error, Decl(parserharness.ts, 243, 55)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) public testStart(test: ITestMetadata) { } >testStart : Symbol(Logger.testStart, Decl(parserharness.ts, 243, 74)) @@ -720,7 +720,7 @@ module Harness { >test : Symbol(test, Decl(parserharness.ts, 248, 21)) >ITestMetadata : Symbol(ITestMetadata, Decl(parserharness.ts, 58, 31)) >error : Symbol(error, Decl(parserharness.ts, 248, 41)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) public comment(comment: string) { } >comment : Symbol(Logger.comment, Decl(parserharness.ts, 248, 59)) @@ -747,9 +747,9 @@ module Harness { >ILogger : Symbol(ILogger, Decl(parserharness.ts, 222, 5)) loggers.push(logger); ->loggers.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>loggers.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >loggers : Symbol(loggers, Decl(parserharness.ts, 254, 7)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >logger : Symbol(logger, Decl(parserharness.ts, 255, 35)) } export function emitLog(field: string, ...params: any[]) { @@ -760,9 +760,9 @@ module Harness { for (var i = 0; i < loggers.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 259, 16)) >i : Symbol(i, Decl(parserharness.ts, 259, 16)) ->loggers.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>loggers.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >loggers : Symbol(loggers, Decl(parserharness.ts, 254, 7)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 259, 16)) if (typeof loggers[i][field] === 'function') { @@ -787,7 +787,7 @@ module Harness { (e?: Error): void; >e : Symbol(e, Decl(parserharness.ts, 268, 9)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } export class Runnable { >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) @@ -804,7 +804,7 @@ module Harness { // The error, if any, that occurred when running 'block' public error: Error = null; >error : Symbol(Runnable.error, Decl(parserharness.ts, 274, 45)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) // Whether or not this object has any failures (including in its descendants) public passed = null; @@ -825,11 +825,11 @@ module Harness { >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) this.children.push(child); ->this.children.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>this.children.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.children : Symbol(Runnable.children, Decl(parserharness.ts, 283, 35)) >this : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >children : Symbol(Runnable.children, Decl(parserharness.ts, 283, 35)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >child : Symbol(child, Decl(parserharness.ts, 288, 24)) } @@ -850,9 +850,9 @@ module Harness { try { if (fn.length === 0) { ->fn.length : Symbol(Function.length, Decl(lib.d.ts, --, --)) +>fn.length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) >fn : Symbol(fn, Decl(parserharness.ts, 296, 20)) ->length : Symbol(Function.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) // No async. fn(); @@ -946,7 +946,7 @@ module Harness { static errorHandlerStack: { (e: Error): void; }[] = []; >errorHandlerStack : Symbol(Runnable.errorHandlerStack, Decl(parserharness.ts, 335, 9)) >e : Symbol(e, Decl(parserharness.ts, 337, 37)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) static pushGlobalErrorHandler(done: IDone) { >pushGlobalErrorHandler : Symbol(Runnable.pushGlobalErrorHandler, Decl(parserharness.ts, 337, 63)) @@ -972,7 +972,7 @@ module Harness { static handleError(e: Error) { >handleError : Symbol(Runnable.handleError, Decl(parserharness.ts, 347, 9)) >e : Symbol(e, Decl(parserharness.ts, 349, 27)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) if (errorHandlerStack.length === 0) { IO.printLine('Global error: ' + e); @@ -1023,7 +1023,7 @@ module Harness { >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) throw new Error("Testcases may not be nested inside other testcases"); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } /** Run the test case block and fail the test if it raised an error. If no error is raised, the test passes. */ @@ -1037,11 +1037,11 @@ module Harness { >this : Symbol(TestCase, Decl(parserharness.ts, 356, 5)) Runnable.currentStack.push(this); ->Runnable.currentStack.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>Runnable.currentStack.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this : Symbol(TestCase, Decl(parserharness.ts, 356, 5)) emitLog('testStart', { desc: this.description }); @@ -1096,11 +1096,11 @@ module Harness { } Runnable.currentStack.pop(); ->Runnable.currentStack.pop : Symbol(Array.pop, Decl(lib.d.ts, --, --)) +>Runnable.currentStack.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->pop : Symbol(Array.pop, Decl(lib.d.ts, --, --)) +>pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) done() >done : Symbol(done, Decl(parserharness.ts, 372, 19)) @@ -1154,11 +1154,11 @@ module Harness { >this : Symbol(Scenario, Decl(parserharness.ts, 398, 5)) Runnable.currentStack.push(this); ->Runnable.currentStack.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>Runnable.currentStack.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this : Symbol(Scenario, Decl(parserharness.ts, 398, 5)) emitLog('scenarioStart', { desc: this.description }); @@ -1176,11 +1176,11 @@ module Harness { >e : Symbol(e, Decl(parserharness.ts, 418, 53)) Runnable.currentStack.pop(); ->Runnable.currentStack.pop : Symbol(Array.pop, Decl(lib.d.ts, --, --)) +>Runnable.currentStack.pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->pop : Symbol(Array.pop, Decl(lib.d.ts, --, --)) +>pop : Symbol(Array.pop, Decl(lib.es5.d.ts, --, --)) if (e) { >e : Symbol(e, Decl(parserharness.ts, 418, 53)) @@ -1256,11 +1256,11 @@ module Harness { for (; index < this.children.length; index++) { >index : Symbol(index, Decl(parserharness.ts, 439, 39)) ->this.children.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.children.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.children : Symbol(Runnable.children, Decl(parserharness.ts, 283, 35)) >this : Symbol(Scenario, Decl(parserharness.ts, 398, 5)) >children : Symbol(Runnable.children, Decl(parserharness.ts, 283, 35)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >index : Symbol(index, Decl(parserharness.ts, 439, 39)) async = this.runChild(index, function (e) { @@ -1369,11 +1369,11 @@ module Harness { for (; index < this.children.length; index++) { >index : Symbol(index, Decl(parserharness.ts, 473, 27)) ->this.children.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.children.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.children : Symbol(Runnable.children, Decl(parserharness.ts, 283, 35)) >this : Symbol(Run, Decl(parserharness.ts, 462, 5)) >children : Symbol(Runnable.children, Decl(parserharness.ts, 283, 35)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >index : Symbol(index, Decl(parserharness.ts, 473, 27)) // Clear out bug descriptions @@ -1474,9 +1474,9 @@ module Harness { >now : Symbol(now, Decl(parserharness.ts, 500, 22)) return Date.now(); ->Date.now : Symbol(DateConstructor.now, Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->now : Symbol(DateConstructor.now, Decl(lib.d.ts, --, --)) +>Date.now : Symbol(DateConstructor.now, Decl(lib.es5.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>now : Symbol(DateConstructor.now, Decl(lib.es5.d.ts, --, --)) } resolution = 1000; @@ -1541,11 +1541,11 @@ module Harness { >value : Symbol(value, Decl(parserharness.ts, 548, 23)) this.data.push(value); ->this.data.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>this.data.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) >this : Symbol(Dataset, Decl(parserharness.ts, 543, 9)) >data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >value : Symbol(value, Decl(parserharness.ts, 548, 23)) } @@ -1558,11 +1558,11 @@ module Harness { for (var i = 0; i < this.data.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 554, 24)) >i : Symbol(i, Decl(parserharness.ts, 554, 24)) ->this.data.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.data.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) >this : Symbol(Dataset, Decl(parserharness.ts, 543, 9)) >data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 554, 24)) sum += this.data[i]; @@ -1575,11 +1575,11 @@ module Harness { return sum / this.data.length; >sum : Symbol(sum, Decl(parserharness.ts, 553, 19)) ->this.data.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.data.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) >this : Symbol(Dataset, Decl(parserharness.ts, 543, 9)) >data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) } public min() { @@ -1594,11 +1594,11 @@ module Harness { for (var i = 1; i < this.data.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 564, 24)) >i : Symbol(i, Decl(parserharness.ts, 564, 24)) ->this.data.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.data.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) >this : Symbol(Dataset, Decl(parserharness.ts, 543, 9)) >data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 564, 24)) if (this.data[i] < min) { @@ -1633,11 +1633,11 @@ module Harness { for (var i = 1; i < this.data.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 576, 24)) >i : Symbol(i, Decl(parserharness.ts, 576, 24)) ->this.data.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.data.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) >this : Symbol(Dataset, Decl(parserharness.ts, 543, 9)) >data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 576, 24)) if (this.data[i] > max) { @@ -1675,18 +1675,18 @@ module Harness { for (var i = 0; i < this.data.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 588, 24)) >i : Symbol(i, Decl(parserharness.ts, 588, 24)) ->this.data.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.data.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) >this : Symbol(Dataset, Decl(parserharness.ts, 543, 9)) >data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 588, 24)) sumOfSquares += Math.pow(this.data[i] - sampleMean, 2); >sumOfSquares : Symbol(sumOfSquares, Decl(parserharness.ts, 587, 19)) ->Math.pow : Symbol(Math.pow, Decl(lib.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->pow : Symbol(Math.pow, Decl(lib.d.ts, --, --)) +>Math.pow : Symbol(Math.pow, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>pow : Symbol(Math.pow, Decl(lib.es5.d.ts, --, --)) >this.data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) >this : Symbol(Dataset, Decl(parserharness.ts, 543, 9)) >data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) @@ -1695,15 +1695,15 @@ module Harness { } return Math.sqrt(sumOfSquares / this.data.length); ->Math.sqrt : Symbol(Math.sqrt, Decl(lib.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->sqrt : Symbol(Math.sqrt, Decl(lib.d.ts, --, --)) +>Math.sqrt : Symbol(Math.sqrt, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>sqrt : Symbol(Math.sqrt, Decl(lib.es5.d.ts, --, --)) >sumOfSquares : Symbol(sumOfSquares, Decl(parserharness.ts, 587, 19)) ->this.data.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.data.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) >this : Symbol(Dataset, Decl(parserharness.ts, 543, 9)) >data : Symbol(Dataset.data, Decl(parserharness.ts, 545, 30)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) } } @@ -1837,9 +1837,9 @@ module Harness { } f.call(benchmark, subBenchmark); ->f.call : Symbol(Function.call, Decl(lib.d.ts, --, --)) +>f.call : Symbol(Function.call, Decl(lib.es5.d.ts, --, --)) >f : Symbol(f, Decl(parserharness.ts, 625, 30)) ->call : Symbol(Function.call, Decl(lib.d.ts, --, --)) +>call : Symbol(Function.call, Decl(lib.es5.d.ts, --, --)) >benchmark : Symbol(benchmark, Decl(parserharness.ts, 622, 33)) >subBenchmark : Symbol(subBenchmark, Decl(parserharness.ts, 632, 15)) @@ -1864,9 +1864,9 @@ module Harness { for (var i = 0; i < benchmarks.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 644, 20)) >i : Symbol(i, Decl(parserharness.ts, 644, 20)) ->benchmarks.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>benchmarks.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >benchmarks : Symbol(benchmarks, Decl(parserharness.ts, 613, 18)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 644, 20)) var b = new benchmarks[i](); @@ -1998,9 +1998,9 @@ module Harness { >BenchmarkClass : Symbol(BenchmarkClass, Decl(parserharness.ts, 679, 37)) benchmarks.push(BenchmarkClass); ->benchmarks.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>benchmarks.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >benchmarks : Symbol(benchmarks, Decl(parserharness.ts, 613, 18)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >BenchmarkClass : Symbol(BenchmarkClass, Decl(parserharness.ts, 679, 37)) } @@ -2038,11 +2038,11 @@ module Harness { >str : Symbol(str, Decl(parserharness.ts, 698, 29)) this.lines.push(this.currentLine + str); ->this.lines.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>this.lines.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) >this : Symbol(WriterAggregator, Decl(parserharness.ts, 686, 28)) >lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.currentLine : Symbol(WriterAggregator.currentLine, Decl(parserharness.ts, 691, 40)) >this : Symbol(WriterAggregator, Decl(parserharness.ts, 686, 28)) >currentLine : Symbol(WriterAggregator.currentLine, Decl(parserharness.ts, 691, 40)) @@ -2058,16 +2058,16 @@ module Harness { >Close : Symbol(WriterAggregator.Close, Decl(parserharness.ts, 701, 13)) if (this.currentLine.length > 0) { this.lines.push(this.currentLine); } ->this.currentLine.length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>this.currentLine.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >this.currentLine : Symbol(WriterAggregator.currentLine, Decl(parserharness.ts, 691, 40)) >this : Symbol(WriterAggregator, Decl(parserharness.ts, 686, 28)) >currentLine : Symbol(WriterAggregator.currentLine, Decl(parserharness.ts, 691, 40)) ->length : Symbol(String.length, Decl(lib.d.ts, --, --)) ->this.lines.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>this.lines.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) >this : Symbol(WriterAggregator, Decl(parserharness.ts, 686, 28)) >lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.currentLine : Symbol(WriterAggregator.currentLine, Decl(parserharness.ts, 691, 40)) >this : Symbol(WriterAggregator, Decl(parserharness.ts, 686, 28)) >currentLine : Symbol(WriterAggregator.currentLine, Decl(parserharness.ts, 691, 40)) @@ -2180,11 +2180,11 @@ module Harness { >fileCollection : Symbol(EmitterIOHost.fileCollection, Decl(parserharness.ts, 715, 72)) if (this.fileCollection.hasOwnProperty(p)) { ->this.fileCollection.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, --, --)) +>this.fileCollection.hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.es5.d.ts, --, --)) >this.fileCollection : Symbol(EmitterIOHost.fileCollection, Decl(parserharness.ts, 715, 72)) >this : Symbol(EmitterIOHost, Decl(parserharness.ts, 712, 9)) >fileCollection : Symbol(EmitterIOHost.fileCollection, Decl(parserharness.ts, 715, 72)) ->hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.d.ts, --, --)) +>hasOwnProperty : Symbol(Object.hasOwnProperty, Decl(lib.es5.d.ts, --, --)) >p : Symbol(p, Decl(parserharness.ts, 740, 24)) var current = this.fileCollection[p]; @@ -2198,25 +2198,25 @@ module Harness { >p : Symbol(p, Decl(parserharness.ts, 740, 24)) if (current.lines.length > 0) { ->current.lines.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>current.lines.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >current.lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) >current : Symbol(current, Decl(parserharness.ts, 742, 27)) >lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) if (p !== '0.js') { current.lines.unshift('////[' + p + ']'); } >p : Symbol(p, Decl(parserharness.ts, 740, 24)) ->current.lines.unshift : Symbol(Array.unshift, Decl(lib.d.ts, --, --)) +>current.lines.unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) >current.lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) >current : Symbol(current, Decl(parserharness.ts, 742, 27)) >lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) ->unshift : Symbol(Array.unshift, Decl(lib.d.ts, --, --)) +>unshift : Symbol(Array.unshift, Decl(lib.es5.d.ts, --, --)) >p : Symbol(p, Decl(parserharness.ts, 740, 24)) result.push({ filename: p, file: this.fileCollection[p] }); ->result.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>result.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 738, 19)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >filename : Symbol(filename, Decl(parserharness.ts, 745, 41)) >p : Symbol(p, Decl(parserharness.ts, 740, 24)) >file : Symbol(file, Decl(parserharness.ts, 745, 54)) @@ -2257,8 +2257,8 @@ module Harness { >filename : Symbol(filename, Decl(parserharness.ts, 759, 38)) return /\.d\.ts$/.test(filename); ->/\.d\.ts$/.test : Symbol(RegExp.test, Decl(lib.d.ts, --, --)) ->test : Symbol(RegExp.test, Decl(lib.d.ts, --, --)) +>/\.d\.ts$/.test : Symbol(RegExp.test, Decl(lib.es5.d.ts, --, --)) +>test : Symbol(RegExp.test, Decl(lib.es5.d.ts, --, --)) >filename : Symbol(filename, Decl(parserharness.ts, 759, 38)) } @@ -2371,15 +2371,15 @@ module Harness { >arg : Symbol(arg, Decl(parserharness.ts, 806, 36)) if ((Array.isArray && Array.isArray(arg)) || arg instanceof Array) ->Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.d.ts, --, --)) ->Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->isArray : Symbol(ArrayConstructor.isArray, Decl(lib.d.ts, --, --)) ->Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.d.ts, --, --)) ->Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->isArray : Symbol(ArrayConstructor.isArray, Decl(lib.d.ts, --, --)) +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) >arg : Symbol(arg, Decl(parserharness.ts, 806, 36)) >arg : Symbol(arg, Decl(parserharness.ts, 806, 36)) ->Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) return arg; >arg : Symbol(arg, Decl(parserharness.ts, 806, 36)) @@ -2516,7 +2516,7 @@ module Harness { >i : Symbol(i, Decl(parserharness.ts, 861, 24)) throw new Error("Expected " + this.type + " to be a subtype of " + others[i].type); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this.type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) >this : Symbol(Type, Decl(parserharness.ts, 800, 9)) >type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) @@ -2551,7 +2551,7 @@ module Harness { >i : Symbol(i, Decl(parserharness.ts, 871, 24)) throw new Error("Expected " + this.type + " to be a subtype of " + others[i].type); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this.type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) >this : Symbol(Type, Decl(parserharness.ts, 800, 9)) >type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) @@ -2659,7 +2659,7 @@ module Harness { >other : Symbol(other, Decl(parserharness.ts, 912, 23)) throw new Error("Expected " + this.type + " to be assignment compatible with " + other.type); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this.type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) >this : Symbol(Type, Decl(parserharness.ts, 800, 9)) >type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) @@ -2697,7 +2697,7 @@ module Harness { >other : Symbol(other, Decl(parserharness.ts, 924, 23)) throw new Error("Expected " + this.type + " to not be assignment compatible with " + other.type); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this.type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) >this : Symbol(Type, Decl(parserharness.ts, 800, 9)) >type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) @@ -2819,7 +2819,7 @@ module Harness { } else { throw new Error("Expected string or number not " + (typeof target)); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >target : Symbol(target, Decl(parserharness.ts, 957, 37)) } @@ -2843,7 +2843,7 @@ module Harness { >errors : Symbol(errors, Decl(parserharness.ts, 970, 19)) throw new Error("Type definition contains errors: " + errors.join(",")); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >errors : Symbol(errors, Decl(parserharness.ts, 970, 19)) var matchingIdentifiers: Type[] = []; @@ -2889,9 +2889,9 @@ module Harness { >targetIdentifier : Symbol(targetIdentifier, Decl(parserharness.ts, 958, 19)) matchingIdentifiers.push(new Type(entries[i].type, code, targetIdentifier)); ->matchingIdentifiers.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>matchingIdentifiers.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >matchingIdentifiers : Symbol(matchingIdentifiers, Decl(parserharness.ts, 978, 19)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >Type : Symbol(Type, Decl(parserharness.ts, 800, 9)) >entries : Symbol(entries, Decl(parserharness.ts, 987, 27)) >i : Symbol(i, Decl(parserharness.ts, 989, 32)) @@ -2940,9 +2940,9 @@ module Harness { >name : Symbol(name, Decl(parserharness.ts, 1002, 35), Decl(parserharness.ts, 1011, 39)) if (!matchingIdentifiers.some(value => (value.identifier === foundValue.identifier) && (value.code === foundValue.code) && (value.type === foundValue.type))) { ->matchingIdentifiers.some : Symbol(Array.some, Decl(lib.d.ts, --, --)) +>matchingIdentifiers.some : Symbol(Array.some, Decl(lib.es5.d.ts, --, --)) >matchingIdentifiers : Symbol(matchingIdentifiers, Decl(parserharness.ts, 978, 19)) ->some : Symbol(Array.some, Decl(lib.d.ts, --, --)) +>some : Symbol(Array.some, Decl(lib.es5.d.ts, --, --)) >value : Symbol(value, Decl(parserharness.ts, 1004, 62)) >value.identifier : Symbol(Type.identifier, Decl(parserharness.ts, 804, 49)) >value : Symbol(value, Decl(parserharness.ts, 1004, 62)) @@ -2964,9 +2964,9 @@ module Harness { >type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) matchingIdentifiers.push(foundValue); ->matchingIdentifiers.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>matchingIdentifiers.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >matchingIdentifiers : Symbol(matchingIdentifiers, Decl(parserharness.ts, 978, 19)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >foundValue : Symbol(foundValue, Decl(parserharness.ts, 1003, 35), Decl(parserharness.ts, 1013, 43)) } } @@ -2974,9 +2974,9 @@ module Harness { for (var pos = 0; pos < code.length; pos++) { >pos : Symbol(pos, Decl(parserharness.ts, 1009, 40)) >pos : Symbol(pos, Decl(parserharness.ts, 1009, 40)) ->code.length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>code.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >code : Symbol(code, Decl(parserharness.ts, 957, 24)) ->length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >pos : Symbol(pos, Decl(parserharness.ts, 1009, 40)) var tyInfo = compiler.pullGetTypeInfoAtPosition(pos, script2); @@ -3004,9 +3004,9 @@ module Harness { >targetIdentifier : Symbol(targetIdentifier, Decl(parserharness.ts, 958, 19)) if (!matchingIdentifiers.some(value => (value.identifier === foundValue.identifier) && (value.code === foundValue.code) && (value.type === foundValue.type))) { ->matchingIdentifiers.some : Symbol(Array.some, Decl(lib.d.ts, --, --)) +>matchingIdentifiers.some : Symbol(Array.some, Decl(lib.es5.d.ts, --, --)) >matchingIdentifiers : Symbol(matchingIdentifiers, Decl(parserharness.ts, 978, 19)) ->some : Symbol(Array.some, Decl(lib.d.ts, --, --)) +>some : Symbol(Array.some, Decl(lib.es5.d.ts, --, --)) >value : Symbol(value, Decl(parserharness.ts, 1014, 70)) >value.identifier : Symbol(Type.identifier, Decl(parserharness.ts, 804, 49)) >value : Symbol(value, Decl(parserharness.ts, 1014, 70)) @@ -3028,9 +3028,9 @@ module Harness { >type : Symbol(Type.type, Decl(parserharness.ts, 804, 24)) matchingIdentifiers.push(foundValue); ->matchingIdentifiers.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>matchingIdentifiers.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >matchingIdentifiers : Symbol(matchingIdentifiers, Decl(parserharness.ts, 978, 19)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >foundValue : Symbol(foundValue, Decl(parserharness.ts, 1003, 35), Decl(parserharness.ts, 1013, 43)) } } @@ -3041,30 +3041,30 @@ module Harness { } if (matchingIdentifiers.length === 0) { ->matchingIdentifiers.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>matchingIdentifiers.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >matchingIdentifiers : Symbol(matchingIdentifiers, Decl(parserharness.ts, 978, 19)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) if (targetPosition > -1) { >targetPosition : Symbol(targetPosition, Decl(parserharness.ts, 959, 19)) throw new Error("Could not find an identifier at position " + targetPosition); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >targetPosition : Symbol(targetPosition, Decl(parserharness.ts, 959, 19)) } else { throw new Error("Could not find an identifier " + targetIdentifier + " in any known scopes"); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >targetIdentifier : Symbol(targetIdentifier, Decl(parserharness.ts, 958, 19)) } } else if (matchingIdentifiers.length > 1) { ->matchingIdentifiers.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>matchingIdentifiers.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >matchingIdentifiers : Symbol(matchingIdentifiers, Decl(parserharness.ts, 978, 19)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) throw new Error("Found multiple matching identifiers for " + target); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >target : Symbol(target, Decl(parserharness.ts, 957, 37)) } else { @@ -3301,9 +3301,9 @@ module Harness { >outputs : Symbol(outputs, Decl(parserharness.ts, 1120, 19)) if (fn.indexOf('.d.ts') >= 0) { ->fn.indexOf : Symbol(String.indexOf, Decl(lib.d.ts, --, --)) +>fn.indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --)) >fn : Symbol(fn, Decl(parserharness.ts, 1136, 24)) ->indexOf : Symbol(String.indexOf, Decl(lib.d.ts, --, --)) +>indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --)) var writer = outputs[fn]; >writer : Symbol(writer, Decl(parserharness.ts, 1138, 27)) @@ -3320,18 +3320,18 @@ module Harness { results = writer.lines.join('\n'); >results : Symbol(results, Decl(parserharness.ts, 1135, 19)) ->writer.lines.join : Symbol(Array.join, Decl(lib.d.ts, --, --)) +>writer.lines.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) >writer.lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) >writer : Symbol(writer, Decl(parserharness.ts, 1138, 27)) >lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) ->join : Symbol(Array.join, Decl(lib.d.ts, --, --)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) if (verifyNoDeclFile && results != "") { >verifyNoDeclFile : Symbol(verifyNoDeclFile, Decl(parserharness.ts, 1106, 54)) >results : Symbol(results, Decl(parserharness.ts, 1135, 19)) throw new Error('Compilation should not produce ' + fn); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >fn : Symbol(fn, Decl(parserharness.ts, 1136, 24)) } } @@ -3348,7 +3348,7 @@ module Harness { >verifyNoDeclFile : Symbol(verifyNoDeclFile, Decl(parserharness.ts, 1106, 54)) throw new Error('Compilation did not produce .d.ts files'); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } } finally { compiler.settings.generateDeclarationFiles = false; @@ -3410,14 +3410,14 @@ module Harness { >lines : Symbol(lines, Decl(parserharness.ts, 1176, 19)) fileResults.forEach(v => lines = lines.concat(v.file.lines)); ->fileResults.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>fileResults.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >fileResults : Symbol(fileResults, Decl(parserharness.ts, 1175, 24)) ->forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >v : Symbol(v, Decl(parserharness.ts, 1177, 36)) >lines : Symbol(lines, Decl(parserharness.ts, 1176, 19)) ->lines.concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>lines.concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >lines : Symbol(lines, Decl(parserharness.ts, 1176, 19)) ->concat : Symbol(Array.concat, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>concat : Symbol(Array.concat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >v.file.lines : Symbol(WriterAggregator.lines, Decl(parserharness.ts, 690, 62)) >v.file : Symbol(file, Decl(parserharness.ts, 1175, 63)) >v : Symbol(v, Decl(parserharness.ts, 1177, 36)) @@ -3428,9 +3428,9 @@ module Harness { >this.code : Symbol(CompilerResult.code, Decl(parserharness.ts, 1170, 37)) >this : Symbol(CompilerResult, Decl(parserharness.ts, 1167, 9)) >code : Symbol(CompilerResult.code, Decl(parserharness.ts, 1170, 37)) ->lines.join : Symbol(Array.join, Decl(lib.d.ts, --, --)) +>lines.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) >lines : Symbol(lines, Decl(parserharness.ts, 1176, 19)) ->join : Symbol(Array.join, Decl(lib.d.ts, --, --)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) this.errors = []; >this.errors : Symbol(CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) @@ -3440,9 +3440,9 @@ module Harness { for (var i = 0; i < errorLines.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 1182, 24)) >i : Symbol(i, Decl(parserharness.ts, 1182, 24)) ->errorLines.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>errorLines.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >errorLines : Symbol(errorLines, Decl(parserharness.ts, 1175, 92)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 1182, 24)) if (Harness.usePull) { @@ -3456,11 +3456,11 @@ module Harness { >i : Symbol(i, Decl(parserharness.ts, 1182, 24)) this.errors.push(new CompilerError(err.filename, 0, 0, err.message)); ->this.errors.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>this.errors.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.errors : Symbol(CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) >this : Symbol(CompilerResult, Decl(parserharness.ts, 1167, 9)) >errors : Symbol(CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >CompilerError : Symbol(CompilerError, Decl(parserharness.ts, 1206, 9)) >err : Symbol(err, Decl(parserharness.ts, 1184, 27)) >err : Symbol(err, Decl(parserharness.ts, 1184, 27)) @@ -3468,25 +3468,25 @@ module Harness { } else { var match = errorLines[i].match(/([^\(]*)\((\d+),(\d+)\):\s+((.*[\s\r\n]*.*)+)\s*$/); >match : Symbol(match, Decl(parserharness.ts, 1187, 27)) ->errorLines[i].match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>errorLines[i].match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) >errorLines : Symbol(errorLines, Decl(parserharness.ts, 1175, 92)) >i : Symbol(i, Decl(parserharness.ts, 1182, 24)) ->match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) if (match) { >match : Symbol(match, Decl(parserharness.ts, 1187, 27)) this.errors.push(new CompilerError(match[1], parseFloat(match[2]), parseFloat(match[3]), match[4])); ->this.errors.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>this.errors.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.errors : Symbol(CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) >this : Symbol(CompilerResult, Decl(parserharness.ts, 1167, 9)) >errors : Symbol(CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >CompilerError : Symbol(CompilerError, Decl(parserharness.ts, 1206, 9)) >match : Symbol(match, Decl(parserharness.ts, 1187, 27)) ->parseFloat : Symbol(parseFloat, Decl(lib.d.ts, --, --)) +>parseFloat : Symbol(parseFloat, Decl(lib.es5.d.ts, --, --)) >match : Symbol(match, Decl(parserharness.ts, 1187, 27)) ->parseFloat : Symbol(parseFloat, Decl(lib.d.ts, --, --)) +>parseFloat : Symbol(parseFloat, Decl(lib.es5.d.ts, --, --)) >match : Symbol(match, Decl(parserharness.ts, 1187, 27)) >match : Symbol(match, Decl(parserharness.ts, 1187, 27)) } @@ -3508,11 +3508,11 @@ module Harness { for (var i = 0; i < this.errors.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 1199, 24)) >i : Symbol(i, Decl(parserharness.ts, 1199, 24)) ->this.errors.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.errors.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.errors : Symbol(CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) >this : Symbol(CompilerResult, Decl(parserharness.ts, 1167, 9)) >errors : Symbol(CompilerResult.errors, Decl(parserharness.ts, 1171, 32)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 1199, 24)) if (this.errors[i].line === line && this.errors[i].column === column && this.errors[i].message === message) @@ -3764,9 +3764,9 @@ module Harness { var filename = path.match(/[^\/]*$/)[0]; >filename : Symbol(filename, Decl(parserharness.ts, 1287, 15)) ->path.match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>path.match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) >path : Symbol(path, Decl(parserharness.ts, 1285, 36)) ->match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) var code = readFile(path); >code : Symbol(code, Decl(parserharness.ts, 1288, 15)) @@ -3888,27 +3888,27 @@ module Harness { var lastUnit = units[units.length - 1]; >lastUnit : Symbol(lastUnit, Decl(parserharness.ts, 1326, 15)) >units : Symbol(units, Decl(parserharness.ts, 1325, 37)) ->units.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>units.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >units : Symbol(units, Decl(parserharness.ts, 1325, 37)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) var unitName = switchToForwardSlashes(lastUnit.name).match(/[^\/]*$/)[0]; >unitName : Symbol(unitName, Decl(parserharness.ts, 1327, 15)) ->switchToForwardSlashes(lastUnit.name).match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>switchToForwardSlashes(lastUnit.name).match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) >switchToForwardSlashes : Symbol(switchToForwardSlashes, Decl(parserharness.ts, 25, 22)) >lastUnit.name : Symbol(TestCaseParser.TestUnitData.name, Decl(parserharness.ts, 1422, 28)) >lastUnit : Symbol(lastUnit, Decl(parserharness.ts, 1326, 15)) >name : Symbol(TestCaseParser.TestUnitData.name, Decl(parserharness.ts, 1422, 28)) ->match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) var dependencies = units.slice(0, units.length - 1); >dependencies : Symbol(dependencies, Decl(parserharness.ts, 1329, 15)) ->units.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>units.slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) >units : Symbol(units, Decl(parserharness.ts, 1325, 37)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) ->units.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) +>units.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >units : Symbol(units, Decl(parserharness.ts, 1325, 37)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) var compilationContext = Harness.Compiler.defineCompilationContextForTest(unitName, dependencies); >compilationContext : Symbol(compilationContext, Decl(parserharness.ts, 1330, 15)) @@ -3999,9 +3999,9 @@ module Harness { >isDeclareFile : Symbol(isDeclareFile, Decl(parserharness.ts, 1352, 15)) scripts.push(addUnit(code, uName, false, isDeclareFile, references)); ->scripts.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>scripts.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >scripts : Symbol(scripts, Decl(parserharness.ts, 1344, 15)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >addUnit : Symbol(addUnit, Decl(parserharness.ts, 1253, 9)) >code : Symbol(code, Decl(parserharness.ts, 1343, 38)) >uName : Symbol(uName, Decl(parserharness.ts, 1354, 15)) @@ -4077,9 +4077,9 @@ module Harness { // if the given file has no dependencies, there is no context to return, it can be compiled without additional work if (dependencies.length == 0) { ->dependencies.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>dependencies.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >dependencies : Symbol(dependencies, Decl(parserharness.ts, 1381, 73)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) return null; } else { @@ -4092,9 +4092,9 @@ module Harness { // REVIEW: if any dependency has a triple slash reference then does postCompile potentially have to do a recreate since we can't update references with updateUnit? // easy enough to do if so, prefer to avoid the recreate cost until it proves to be an issue dependencies.forEach(dep => { ->dependencies.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>dependencies.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >dependencies : Symbol(dependencies, Decl(parserharness.ts, 1381, 73)) ->forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >dep : Symbol(dep, Decl(parserharness.ts, 1390, 41)) addUnit(dep.content, dep.name, false, Harness.Compiler.isDeclareFile(dep.name)); @@ -4115,9 +4115,9 @@ module Harness { >name : Symbol(TestCaseParser.TestUnitData.name, Decl(parserharness.ts, 1422, 28)) addedFiles.push(dep.name); ->addedFiles.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>addedFiles.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >addedFiles : Symbol(addedFiles, Decl(parserharness.ts, 1386, 19)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >dep.name : Symbol(TestCaseParser.TestUnitData.name, Decl(parserharness.ts, 1422, 28)) >dep : Symbol(dep, Decl(parserharness.ts, 1390, 41)) >name : Symbol(TestCaseParser.TestUnitData.name, Decl(parserharness.ts, 1422, 28)) @@ -4128,9 +4128,9 @@ module Harness { >postcompile : Symbol(postcompile, Decl(parserharness.ts, 1395, 19)) addedFiles.forEach(file => { ->addedFiles.forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>addedFiles.forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >addedFiles : Symbol(addedFiles, Decl(parserharness.ts, 1386, 19)) ->forEach : Symbol(Array.forEach, Decl(lib.d.ts, --, --)) +>forEach : Symbol(Array.forEach, Decl(lib.es5.d.ts, --, --)) >file : Symbol(file, Decl(parserharness.ts, 1396, 39)) updateUnit('', file); @@ -4218,9 +4218,9 @@ module Harness { >content : Symbol(content, Decl(parserharness.ts, 1434, 41)) opts.push({ flag: match[1], value: match[2] }); ->opts.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>opts.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >opts : Symbol(opts, Decl(parserharness.ts, 1436, 15)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >flag : Symbol(flag, Decl(parserharness.ts, 1440, 27)) >match : Symbol(match, Decl(parserharness.ts, 1438, 15)) >value : Symbol(value, Decl(parserharness.ts, 1440, 43)) @@ -4272,9 +4272,9 @@ module Harness { for (var i = 0; i < lines.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 1462, 20)) >i : Symbol(i, Decl(parserharness.ts, 1462, 20)) ->lines.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>lines.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >lines : Symbol(lines, Decl(parserharness.ts, 1454, 15)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 1462, 20)) var line = lines[i]; @@ -4284,8 +4284,8 @@ module Harness { var isTripleSlashReference = /[\/]{3}\s*isTripleSlashReference : Symbol(isTripleSlashReference, Decl(parserharness.ts, 1464, 19)) ->/[\/]{3}\s*test : Symbol(RegExp.test, Decl(lib.d.ts, --, --)) +>/[\/]{3}\s*test : Symbol(RegExp.test, Decl(lib.es5.d.ts, --, --)) >line : Symbol(line, Decl(parserharness.ts, 1463, 19)) var testMetaData = optionRegex.exec(line); @@ -4298,9 +4298,9 @@ module Harness { var isRef = line.match(/reference\spath='(\w*_?\w*\.?d?\.ts)'/); >isRef : Symbol(isRef, Decl(parserharness.ts, 1468, 23)) ->line.match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>line.match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) >line : Symbol(line, Decl(parserharness.ts, 1463, 19)) ->match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) if (isRef) { >isRef : Symbol(isRef, Decl(parserharness.ts, 1468, 23)) @@ -4330,9 +4330,9 @@ module Harness { }; refs.push(ref); ->refs.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>refs.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >refs : Symbol(refs, Decl(parserharness.ts, 1460, 15)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >ref : Symbol(ref, Decl(parserharness.ts, 1470, 27)) } } else if (testMetaData) { @@ -4342,20 +4342,20 @@ module Harness { optionRegex.lastIndex = 0; var fileNameIndex = fileMetadataNames.indexOf(testMetaData[1].toLowerCase()); >fileNameIndex : Symbol(fileNameIndex, Decl(parserharness.ts, 1484, 23)) ->fileMetadataNames.indexOf : Symbol(Array.indexOf, Decl(lib.d.ts, --, --)) +>fileMetadataNames.indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) >fileMetadataNames : Symbol(fileMetadataNames, Decl(parserharness.ts, 1432, 11)) ->indexOf : Symbol(Array.indexOf, Decl(lib.d.ts, --, --)) +>indexOf : Symbol(Array.indexOf, Decl(lib.es5.d.ts, --, --)) >testMetaData : Symbol(testMetaData, Decl(parserharness.ts, 1465, 19)) if (fileNameIndex == -1) { >fileNameIndex : Symbol(fileNameIndex, Decl(parserharness.ts, 1484, 23)) throw new Error('Unrecognized metadata name "' + testMetaData[1] + '". Available file metadata names are: ' + fileMetadataNames.join(', ')); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >testMetaData : Symbol(testMetaData, Decl(parserharness.ts, 1465, 19)) ->fileMetadataNames.join : Symbol(Array.join, Decl(lib.d.ts, --, --)) +>fileMetadataNames.join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) >fileMetadataNames : Symbol(fileMetadataNames, Decl(parserharness.ts, 1432, 11)) ->join : Symbol(Array.join, Decl(lib.d.ts, --, --)) +>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --)) } else if (fileNameIndex == 0) { >fileNameIndex : Symbol(fileNameIndex, Decl(parserharness.ts, 1484, 23)) @@ -4399,9 +4399,9 @@ module Harness { }; files.push(newTestFile); ->files.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>files.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >files : Symbol(files, Decl(parserharness.ts, 1452, 15)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >newTestFile : Symbol(newTestFile, Decl(parserharness.ts, 1496, 27), Decl(parserharness.ts, 1532, 15)) // Reset local data @@ -4449,9 +4449,9 @@ module Harness { // normalize the filename for the single file case currentFileName = files.length > 0 ? currentFileName : '0.ts'; >currentFileName : Symbol(currentFileName, Decl(parserharness.ts, 1459, 15)) ->files.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>files.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >files : Symbol(files, Decl(parserharness.ts, 1452, 15)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >currentFileName : Symbol(currentFileName, Decl(parserharness.ts, 1459, 15)) // EOF, push whatever remains @@ -4480,9 +4480,9 @@ module Harness { }; files.push(newTestFile); ->files.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>files.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >files : Symbol(files, Decl(parserharness.ts, 1452, 15)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >newTestFile : Symbol(newTestFile, Decl(parserharness.ts, 1496, 27), Decl(parserharness.ts, 1532, 15)) return { settings: settings, testUnitData: files }; @@ -4553,11 +4553,11 @@ module Harness { // Apply edits var prefix = this.content.substring(0, minChar); >prefix : Symbol(prefix, Decl(parserharness.ts, 1562, 15)) ->this.content.substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>this.content.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >this.content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) ->substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >minChar : Symbol(minChar, Decl(parserharness.ts, 1560, 27)) var middle = newText; @@ -4566,11 +4566,11 @@ module Harness { var suffix = this.content.substring(limChar); >suffix : Symbol(suffix, Decl(parserharness.ts, 1564, 15)) ->this.content.substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>this.content.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >this.content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) ->substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >limChar : Symbol(limChar, Decl(parserharness.ts, 1560, 43)) this.content = prefix + middle + suffix; @@ -4583,19 +4583,19 @@ module Harness { // Store edit range + new length of script this.editRanges.push({ ->this.editRanges.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>this.editRanges.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) length: this.content.length, >length : Symbol(length, Decl(parserharness.ts, 1568, 34)) ->this.content.length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>this.content.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >this.content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) ->length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) editRange: new TypeScript.ScriptEditRange(minChar, limChar, (limChar - minChar) + newText.length) >editRange : Symbol(editRange, Decl(parserharness.ts, 1569, 44)) @@ -4603,36 +4603,36 @@ module Harness { >limChar : Symbol(limChar, Decl(parserharness.ts, 1560, 43)) >limChar : Symbol(limChar, Decl(parserharness.ts, 1560, 43)) >minChar : Symbol(minChar, Decl(parserharness.ts, 1560, 27)) ->newText.length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>newText.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >newText : Symbol(newText, Decl(parserharness.ts, 1560, 60)) ->length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) }); if (this.editRanges.length > this.maxScriptVersions) { ->this.editRanges.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.editRanges.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.maxScriptVersions : Symbol(ScriptInfo.maxScriptVersions, Decl(parserharness.ts, 1549, 92)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >maxScriptVersions : Symbol(ScriptInfo.maxScriptVersions, Decl(parserharness.ts, 1549, 92)) this.editRanges.splice(0, this.maxScriptVersions - this.editRanges.length); ->this.editRanges.splice : Symbol(Array.splice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>this.editRanges.splice : Symbol(Array.splice, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this.editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) ->splice : Symbol(Array.splice, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>splice : Symbol(Array.splice, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >this.maxScriptVersions : Symbol(ScriptInfo.maxScriptVersions, Decl(parserharness.ts, 1549, 92)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >maxScriptVersions : Symbol(ScriptInfo.maxScriptVersions, Decl(parserharness.ts, 1549, 92)) ->this.editRanges.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.editRanges.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) } // Update version # @@ -4658,11 +4658,11 @@ module Harness { var initialEditRangeIndex = this.editRanges.length - (this.version - version); >initialEditRangeIndex : Symbol(initialEditRangeIndex, Decl(parserharness.ts, 1587, 15)) ->this.editRanges.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.editRanges.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.version : Symbol(ScriptInfo.version, Decl(parserharness.ts, 1545, 29)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >version : Symbol(ScriptInfo.version, Decl(parserharness.ts, 1545, 29)) @@ -4671,11 +4671,11 @@ module Harness { if (initialEditRangeIndex < 0 || initialEditRangeIndex >= this.editRanges.length) { >initialEditRangeIndex : Symbol(initialEditRangeIndex, Decl(parserharness.ts, 1587, 15)) >initialEditRangeIndex : Symbol(initialEditRangeIndex, Decl(parserharness.ts, 1587, 15)) ->this.editRanges.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.editRanges.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) // Too far away from what we know return TypeScript.ScriptEditRange.unknown(); @@ -4683,38 +4683,38 @@ module Harness { var entries = this.editRanges.slice(initialEditRangeIndex); >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) ->this.editRanges.slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>this.editRanges.slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) >this.editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) >this : Symbol(ScriptInfo, Decl(parserharness.ts, 1543, 5)) >editRanges : Symbol(ScriptInfo.editRanges, Decl(parserharness.ts, 1546, 31)) ->slice : Symbol(Array.slice, Decl(lib.d.ts, --, --)) +>slice : Symbol(Array.slice, Decl(lib.es5.d.ts, --, --)) >initialEditRangeIndex : Symbol(initialEditRangeIndex, Decl(parserharness.ts, 1587, 15)) var minDistFromStart = entries.map(x => x.editRange.minChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromStart : Symbol(minDistFromStart, Decl(parserharness.ts, 1595, 15)) ->entries.map(x => x.editRange.minChar).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->entries.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>entries.map(x => x.editRange.minChar).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(parserharness.ts, 1595, 47)) >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1595, 47)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1595, 81)) >current : Symbol(current, Decl(parserharness.ts, 1595, 86)) ->Math.min : Symbol(Math.min, Decl(lib.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->min : Symbol(Math.min, Decl(lib.d.ts, --, --)) +>Math.min : Symbol(Math.min, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>min : Symbol(Math.min, Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1595, 81)) >current : Symbol(current, Decl(parserharness.ts, 1595, 86)) var minDistFromEnd = entries.map(x => x.length - x.editRange.limChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromEnd : Symbol(minDistFromEnd, Decl(parserharness.ts, 1596, 15)) ->entries.map(x => x.length - x.editRange.limChar).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->entries.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>entries.map(x => x.length - x.editRange.limChar).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(parserharness.ts, 1596, 45)) >x.length : Symbol(length, Decl(parserharness.ts, 1547, 28)) >x : Symbol(x, Decl(parserharness.ts, 1596, 45)) @@ -4722,26 +4722,26 @@ module Harness { >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1596, 45)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1596, 90)) >current : Symbol(current, Decl(parserharness.ts, 1596, 95)) ->Math.min : Symbol(Math.min, Decl(lib.d.ts, --, --)) ->Math : Symbol(Math, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->min : Symbol(Math.min, Decl(lib.d.ts, --, --)) +>Math.min : Symbol(Math.min, Decl(lib.es5.d.ts, --, --)) +>Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>min : Symbol(Math.min, Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1596, 90)) >current : Symbol(current, Decl(parserharness.ts, 1596, 95)) var aggDelta = entries.map(x => x.editRange.delta).reduce((prev, current) => prev + current); >aggDelta : Symbol(aggDelta, Decl(parserharness.ts, 1597, 15)) ->entries.map(x => x.editRange.delta).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->entries.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>entries.map(x => x.editRange.delta).reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>entries.map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) ->map : Symbol(Array.map, Decl(lib.d.ts, --, --)) +>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) >x : Symbol(x, Decl(parserharness.ts, 1597, 39)) >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1597, 39)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1597, 71)) >current : Symbol(current, Decl(parserharness.ts, 1597, 76)) >prev : Symbol(prev, Decl(parserharness.ts, 1597, 71)) @@ -4820,11 +4820,11 @@ module Harness { >maxScriptVersions : Symbol(TypeScriptLS.maxScriptVersions, Decl(parserharness.ts, 1606, 42)) this.scripts.push(script); ->this.scripts.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>this.scripts.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >this.scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) >this : Symbol(TypeScriptLS, Decl(parserharness.ts, 1601, 5)) >scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >script : Symbol(script, Decl(parserharness.ts, 1619, 15)) } @@ -4837,11 +4837,11 @@ module Harness { for (var i = 0; i < this.scripts.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 1624, 20)) >i : Symbol(i, Decl(parserharness.ts, 1624, 20)) ->this.scripts.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.scripts.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) >this : Symbol(TypeScriptLS, Decl(parserharness.ts, 1601, 5)) >scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 1624, 20)) if (this.scripts[i].name == name) { @@ -4886,11 +4886,11 @@ module Harness { for (var i = 0; i < this.scripts.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 1635, 20)) >i : Symbol(i, Decl(parserharness.ts, 1635, 20)) ->this.scripts.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.scripts.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) >this : Symbol(TypeScriptLS, Decl(parserharness.ts, 1601, 5)) >scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 1635, 20)) if (this.scripts[i].name == name) { @@ -4918,7 +4918,7 @@ module Harness { } throw new Error("No script with name '" + name + "'"); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >name : Symbol(name, Decl(parserharness.ts, 1634, 26)) } @@ -4975,11 +4975,11 @@ module Harness { >getScriptCount : Symbol(TypeScriptLS.getScriptCount, Decl(parserharness.ts, 1669, 9)) return this.scripts.length; ->this.scripts.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>this.scripts.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >this.scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) >this : Symbol(TypeScriptLS, Decl(parserharness.ts, 1601, 5)) >scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) } public getScriptSourceText(scriptIndex: number, start: number, end: number): string { @@ -4989,14 +4989,14 @@ module Harness { >end : Symbol(end, Decl(parserharness.ts, 1675, 70)) return this.scripts[scriptIndex].content.substring(start, end); ->this.scripts[scriptIndex].content.substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>this.scripts[scriptIndex].content.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >this.scripts[scriptIndex].content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) >this.scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) >this : Symbol(TypeScriptLS, Decl(parserharness.ts, 1601, 5)) >scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) >scriptIndex : Symbol(scriptIndex, Decl(parserharness.ts, 1675, 35)) >content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) ->substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >start : Symbol(start, Decl(parserharness.ts, 1675, 55)) >end : Symbol(end, Decl(parserharness.ts, 1675, 70)) } @@ -5006,14 +5006,14 @@ module Harness { >scriptIndex : Symbol(scriptIndex, Decl(parserharness.ts, 1679, 37)) return this.scripts[scriptIndex].content.length; ->this.scripts[scriptIndex].content.length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>this.scripts[scriptIndex].content.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) >this.scripts[scriptIndex].content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) >this.scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) >this : Symbol(TypeScriptLS, Decl(parserharness.ts, 1601, 5)) >scripts : Symbol(TypeScriptLS.scripts, Decl(parserharness.ts, 1604, 57)) >scriptIndex : Symbol(scriptIndex, Decl(parserharness.ts, 1679, 37)) >content : Symbol(ScriptInfo.content, Decl(parserharness.ts, 1549, 40)) ->length : Symbol(String.length, Decl(lib.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) } public getScriptId(scriptIndex: number): string { @@ -5283,9 +5283,9 @@ module Harness { for (var i = edits.length - 1; i >= 0; i--) { >i : Symbol(i, Decl(parserharness.ts, 1772, 20)) ->edits.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>edits.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >edits : Symbol(edits, Decl(parserharness.ts, 1768, 42)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 1772, 20)) >i : Symbol(i, Decl(parserharness.ts, 1772, 20)) @@ -5296,9 +5296,9 @@ module Harness { var prefix = result.substring(0, edit.minChar); >prefix : Symbol(prefix, Decl(parserharness.ts, 1774, 19)) ->result.substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>result.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 1769, 15)) ->substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >edit : Symbol(edit, Decl(parserharness.ts, 1773, 19)) var middle = edit.text; @@ -5307,9 +5307,9 @@ module Harness { var suffix = result.substring(edit.limChar); >suffix : Symbol(suffix, Decl(parserharness.ts, 1776, 19)) ->result.substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>result.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 1769, 15)) ->substring : Symbol(String.substring, Decl(lib.d.ts, --, --)) +>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) >edit : Symbol(edit, Decl(parserharness.ts, 1773, 19)) result = prefix + middle + suffix; @@ -5342,15 +5342,15 @@ module Harness { for (var i = 0; i < edits.length; i++) { >i : Symbol(i, Decl(parserharness.ts, 1788, 24)) >i : Symbol(i, Decl(parserharness.ts, 1788, 24)) ->edits.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>edits.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >edits : Symbol(edits, Decl(parserharness.ts, 1786, 30)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >i : Symbol(i, Decl(parserharness.ts, 1788, 24)) result.push({ edit: edits[i], index: i }); ->result.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>result.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 1787, 19)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >edit : Symbol(edit, Decl(parserharness.ts, 1789, 33)) >edits : Symbol(edits, Decl(parserharness.ts, 1786, 30)) >i : Symbol(i, Decl(parserharness.ts, 1788, 24)) @@ -5363,10 +5363,10 @@ module Harness { var temp = mapEdits(edits).sort(function (a, b) { >temp : Symbol(temp, Decl(parserharness.ts, 1794, 15)) ->mapEdits(edits).sort : Symbol(Array.sort, Decl(lib.d.ts, --, --)) +>mapEdits(edits).sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >mapEdits : Symbol(mapEdits, Decl(parserharness.ts, 1784, 49)) >edits : Symbol(edits, Decl(parserharness.ts, 1783, 31)) ->sort : Symbol(Array.sort, Decl(lib.d.ts, --, --)) +>sort : Symbol(Array.sort, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(parserharness.ts, 1794, 54)) >b : Symbol(b, Decl(parserharness.ts, 1794, 56)) @@ -5404,9 +5404,9 @@ module Harness { while (current < temp.length) { >current : Symbol(current, Decl(parserharness.ts, 1801, 15)) ->temp.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>temp.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >temp : Symbol(temp, Decl(parserharness.ts, 1794, 15)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) var currentEdit = temp[current].edit; >currentEdit : Symbol(currentEdit, Decl(parserharness.ts, 1804, 19)) @@ -5418,14 +5418,14 @@ module Harness { // Last edit if (next >= temp.length) { >next : Symbol(next, Decl(parserharness.ts, 1802, 15)) ->temp.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>temp.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >temp : Symbol(temp, Decl(parserharness.ts, 1794, 15)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) result.push(currentEdit); ->result.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>result.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 1784, 15)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >currentEdit : Symbol(currentEdit, Decl(parserharness.ts, 1804, 19)) current++; @@ -5450,9 +5450,9 @@ module Harness { >gap : Symbol(gap, Decl(parserharness.ts, 1814, 19)) result.push(currentEdit); ->result.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>result.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 1784, 15)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >currentEdit : Symbol(currentEdit, Decl(parserharness.ts, 1804, 19)) current = next; @@ -5478,7 +5478,7 @@ module Harness { } else { throw new Error("Trying to apply overlapping edits"); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } } @@ -5490,9 +5490,9 @@ module Harness { >getHostSettings : Symbol(TypeScriptLS.getHostSettings, Decl(parserharness.ts, 1836, 9)) return JSON.stringify({ usePullLanguageService: usePull }); ->JSON.stringify : Symbol(JSON.stringify, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->JSON : Symbol(JSON, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->stringify : Symbol(JSON.stringify, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>JSON.stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>JSON : Symbol(JSON, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>stringify : Symbol(JSON.stringify, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >usePullLanguageService : Symbol(usePullLanguageService, Decl(parserharness.ts, 1839, 35)) >usePull : Symbol(usePull, Decl(parserharness.ts, 58, 14)) } @@ -5511,18 +5511,18 @@ module Harness { >block : Symbol(block, Decl(parserharness.ts, 1844, 49)) if (Runnable.currentStack.length === 0) { ->Runnable.currentStack.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>Runnable.currentStack.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) Runnable.currentStack.push(currentRun); ->Runnable.currentStack.push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>Runnable.currentStack.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->push : Symbol(Array.push, Decl(lib.d.ts, --, --)) +>push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) >currentRun : Symbol(currentRun, Decl(parserharness.ts, 2073, 7)) } @@ -5531,11 +5531,11 @@ module Harness { >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->Runnable.currentStack.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>Runnable.currentStack.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >addChild : Symbol(Runnable.addChild, Decl(parserharness.ts, 286, 41)) >newScenario : Symbol(newScenario, Decl(parserharness.ts, 1845, 11)) } @@ -5555,11 +5555,11 @@ module Harness { >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->Runnable.currentStack.length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>Runnable.currentStack.length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >Runnable.currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) >Runnable : Symbol(Runnable, Decl(parserharness.ts, 269, 5)) >currentStack : Symbol(Runnable.currentStack, Decl(parserharness.ts, 271, 70)) ->length : Symbol(Array.length, Decl(lib.d.ts, --, --)) +>length : Symbol(Array.length, Decl(lib.es5.d.ts, --, --)) >addChild : Symbol(Runnable.addChild, Decl(parserharness.ts, 286, 41)) >testCase : Symbol(testCase, Decl(parserharness.ts, 1854, 11)) } @@ -5599,7 +5599,7 @@ module Harness { >path : Symbol(path, Decl(parserharness.ts, 1869, 38)) >callback : Symbol(callback, Decl(parserharness.ts, 1869, 51)) >error : Symbol(error, Decl(parserharness.ts, 1869, 63)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 1869, 76)) path = switchToForwardSlashes(path); @@ -5611,9 +5611,9 @@ module Harness { >runString : Symbol(runString, Decl(parserharness.ts, 1899, 9)) >readFile : Symbol(readFile, Decl(parserharness.ts, 207, 5)) >path : Symbol(path, Decl(parserharness.ts, 1869, 38)) ->path.match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>path.match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) >path : Symbol(path, Decl(parserharness.ts, 1869, 38)) ->match : Symbol(String.match, Decl(lib.d.ts, --, --)) +>match : Symbol(String.match, Decl(lib.es5.d.ts, --, --)) >callback : Symbol(callback, Decl(parserharness.ts, 1869, 51)) } @@ -5622,7 +5622,7 @@ module Harness { >code : Symbol(code, Decl(parserharness.ts, 1874, 36)) >callback : Symbol(callback, Decl(parserharness.ts, 1874, 49)) >error : Symbol(error, Decl(parserharness.ts, 1874, 61)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 1874, 74)) // List of names that get overriden by various test code we eval @@ -5651,7 +5651,7 @@ module Harness { try { var res = eval(code); >res : Symbol(res, Decl(parserharness.ts, 1885, 19)) ->eval : Symbol(eval, Decl(lib.d.ts, --, --)) +>eval : Symbol(eval, Decl(lib.es5.d.ts, --, --)) >code : Symbol(code, Decl(parserharness.ts, 1874, 36)) for (n in dangerNames) { @@ -5699,7 +5699,7 @@ module Harness { >unitName : Symbol(unitName, Decl(parserharness.ts, 1901, 47)) >callback : Symbol(callback, Decl(parserharness.ts, 1901, 65)) >error : Symbol(error, Decl(parserharness.ts, 1901, 77)) ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >result : Symbol(result, Decl(parserharness.ts, 1901, 90)) Compiler.compileString(code, unitName, function (res) { @@ -5850,9 +5850,9 @@ module Harness { reportContent = reportContent.replace(htmlTrailer, ''); >reportContent : Symbol(reportContent, Decl(parserharness.ts, 1955, 15)) ->reportContent.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reportContent.replace : Symbol(String.replace, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >reportContent : Symbol(reportContent, Decl(parserharness.ts, 1955, 15)) ->replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>replace : Symbol(String.replace, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >htmlTrailer : Symbol(htmlTrailer, Decl(parserharness.ts, 1913, 11)) } else { @@ -5900,7 +5900,7 @@ module Harness { >undefined : Symbol(undefined) throw new Error('The generated content was "undefined". Return "null" if no baselining is required."'); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } // Store the content in the 'local' folder so we @@ -5972,15 +5972,15 @@ module Harness { expected = expected.replace(/\r\n?/g, '\n') >expected : Symbol(expected, Decl(parserharness.ts, 2005, 15)) ->expected.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>expected.replace : Symbol(String.replace, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >expected : Symbol(expected, Decl(parserharness.ts, 2005, 15)) ->replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>replace : Symbol(String.replace, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) actual = actual.replace(/\r\n?/g, '\n') >actual : Symbol(actual, Decl(parserharness.ts, 1991, 35)) ->actual.replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>actual.replace : Symbol(String.replace, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >actual : Symbol(actual, Decl(parserharness.ts, 1991, 35)) ->replace : Symbol(String.replace, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>replace : Symbol(String.replace, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) } return { expected: expected, actual: actual }; @@ -6051,7 +6051,7 @@ module Harness { >reportContentSoFar : Symbol(reportContentSoFar, Decl(parserharness.ts, 2034, 19)) throw new Error(errMsg); ->Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >errMsg : Symbol(errMsg, Decl(parserharness.ts, 2023, 19)) } } diff --git a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt index 67a62a2269c29..eec311388c202 100644 --- a/tests/baselines/reference/privacyAccessorDeclFile.errors.txt +++ b/tests/baselines/reference/privacyAccessorDeclFile.errors.txt @@ -1,15 +1,3 @@ -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(253,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(259,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(265,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(271,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(361,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(365,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(405,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(408,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(411,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(414,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(420,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(422,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(8,40): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(14,27): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(20,16): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. @@ -34,6 +22,18 @@ tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(368,20): error TS tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(371,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(377,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts(379,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(253,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(259,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(265,20): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(271,13): error TS4043: Return type of public property getter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(361,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(365,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(405,44): error TS4040: Return type of public static property getter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(408,31): error TS4043: Return type of public property getter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(411,20): error TS4039: Return type of public static property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(414,13): error TS4042: Return type of public property getter from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(420,48): error TS4037: Parameter 'myPublicStaticMethod' of public property setter from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyAccessorDeclFile_GlobalFile.ts(422,35): error TS4037: Parameter 'myPublicMethod' of public property setter from exported class has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyAccessorDeclFile_externalModule.ts (24 errors) ==== diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt index 23559cd9a3c18..5bbc12d40b0b5 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt @@ -1,10 +1,10 @@ -tests/cases/compiler/privacyClassExtendsClauseDeclFile_GlobalFile.ts(16,67): error TS4020: 'extends' clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(16,67): error TS4020: 'extends' clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(19,77): error TS2449: Class 'publicClassInPrivateModule' used before its declaration. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(21,69): error TS4020: 'extends' clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(21,83): error TS2449: Class 'publicClassInPrivateModule' used before its declaration. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(63,55): error TS4020: 'extends' clause of exported class 'publicClassExtendingPrivateClass' has or is using private name 'privateClass'. tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(68,65): error TS4020: 'extends' clause of exported class 'publicClassExtendingFromPrivateModuleClass' has or is using private name 'privateModule'. +tests/cases/compiler/privacyClassExtendsClauseDeclFile_GlobalFile.ts(16,67): error TS4020: 'extends' clause of exported class 'publicClassExtendingPrivateClassInModule' has or is using private name 'privateClassInPublicModule'. ==== tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts (6 errors) ==== diff --git a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt index 586d4530c8e7e..4433ffa162897 100644 --- a/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassImplementsClauseDeclFile.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/privacyClassImplementsClauseDeclFile_GlobalFile.ts(14,77): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(14,77): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(19,79): error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(22,78): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateAndPublicInterface' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(62,65): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterface' has or is using private name 'privateInterface'. tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts(67,75): error TS4019: Implements clause of exported class 'publicClassImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. +tests/cases/compiler/privacyClassImplementsClauseDeclFile_GlobalFile.ts(14,77): error TS4019: Implements clause of exported class 'publicClassImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. ==== tests/cases/compiler/privacyClassImplementsClauseDeclFile_externalModule.ts (5 errors) ==== diff --git a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt index 8367483ca979f..25e07e73bbc41 100644 --- a/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionParameterDeclFile.errors.txt @@ -1,23 +1,3 @@ -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(164,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(165,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(166,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(188,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(192,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,58): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,87): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(239,67): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(248,82): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(254,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(255,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(256,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(259,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(261,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,71): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,113): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(266,74): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(268,89): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(8,17): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(9,13): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(10,21): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. @@ -58,6 +38,26 @@ tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(239,71): tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(239,113): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(242,74): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts(244,89): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(164,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(165,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(166,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(188,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(192,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,58): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(196,87): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(239,67): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(248,82): error TS4078: Parameter 'param' of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(254,21): error TS4065: Parameter 'param' of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(255,17): error TS4067: Parameter 'param' of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(256,25): error TS4075: Parameter 'param' of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(259,44): error TS4070: Parameter 'param' of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(261,31): error TS4073: Parameter 'param' of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,28): error TS4063: Parameter 'param' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,71): error TS4063: Parameter 'param1' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(263,113): error TS4063: Parameter 'param2' of constructor from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(266,74): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionParameterDeclFile_GlobalFile.ts(268,89): error TS4078: Parameter 'param' of exported function has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyFunctionParameterDeclFile_externalModule.ts (40 errors) ==== diff --git a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt index 94c8b20311ca4..5c9e0a235bd5d 100644 --- a/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt +++ b/tests/baselines/reference/privacyFunctionReturnTypeDeclFile.errors.txt @@ -1,25 +1,3 @@ -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(281,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(282,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(283,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(284,21): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(309,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(315,27): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(321,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(327,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(416,63): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(428,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(441,78): error TS4060: Return type of exported function has or is using private name 'privateClass'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(447,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(448,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(449,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(450,21): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(453,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(456,27): error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(459,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(462,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(466,70): error TS4060: Return type of exported function has or is using private name 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(469,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. -tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(472,85): error TS4060: Return type of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(8,13): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(9,9): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(10,18): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. @@ -64,6 +42,28 @@ tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(418,9): tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(422,70): error TS4060: Return type of exported function has or is using private name 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(425,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts(428,85): error TS4060: Return type of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(281,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(282,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(283,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(284,21): error TS4057: Return type of method from exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(309,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(315,27): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(321,16): error TS4052: Return type of public static method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(327,9): error TS4055: Return type of public method from exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(416,63): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(428,21): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(441,78): error TS4060: Return type of exported function has or is using private name 'privateClass'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(447,17): error TS4045: Return type of constructor signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(448,13): error TS4047: Return type of call signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(449,22): error TS4049: Return type of index signature from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(450,21): error TS4057: Return type of method from exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(453,40): error TS4052: Return type of public static method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(456,27): error TS4055: Return type of public method from exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(459,16): error TS4051: Return type of public static method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(462,9): error TS4054: Return type of public method from exported class has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(466,70): error TS4060: Return type of exported function has or is using private name 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(469,21): error TS4059: Return type of exported function has or is using name 'privateModule.publicClass' from private module 'privateModule'. +tests/cases/compiler/privacyFunctionReturnTypeDeclFile_GlobalFile.ts(472,85): error TS4060: Return type of exported function has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyFunctionReturnTypeDeclFile_externalModule.ts (44 errors) ==== diff --git a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt index 0669d3c3d2647..e31227b5f8aa0 100644 --- a/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyInterfaceExtendsClauseDeclFile.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_GlobalFile.ts(14,82): error TS4022: 'extends' clause of exported interface 'publicInterfaceImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(14,82): error TS4022: 'extends' clause of exported interface 'publicInterfaceImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(19,84): error TS4022: 'extends' clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(22,83): error TS4022: 'extends' clause of exported interface 'publicInterfaceImplementingPrivateAndPublicInterface' has or is using private name 'privateInterfaceInPublicModule'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(62,70): error TS4022: 'extends' clause of exported interface 'publicInterfaceImplementingPrivateInterface' has or is using private name 'privateInterface'. tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts(67,80): error TS4022: 'extends' clause of exported interface 'publicInterfaceImplementingFromPrivateModuleInterface' has or is using private name 'privateModule'. +tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_GlobalFile.ts(14,82): error TS4022: 'extends' clause of exported interface 'publicInterfaceImplementingPrivateInterfaceInModule' has or is using private name 'privateInterfaceInPublicModule'. ==== tests/cases/compiler/privacyInterfaceExtendsClauseDeclFile_externalModule.ts (5 errors) ==== diff --git a/tests/baselines/reference/privacyVarDeclFile.errors.txt b/tests/baselines/reference/privacyVarDeclFile.errors.txt index c6ee30d663070..7f34767683a39 100644 --- a/tests/baselines/reference/privacyVarDeclFile.errors.txt +++ b/tests/baselines/reference/privacyVarDeclFile.errors.txt @@ -1,13 +1,3 @@ -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(105,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(121,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(123,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(148,51): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(153,66): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(159,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(162,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(163,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(165,57): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. -tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(166,72): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. tests/cases/compiler/privacyVarDeclFile_externalModule.ts(8,17): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. tests/cases/compiler/privacyVarDeclFile_externalModule.ts(24,36): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. tests/cases/compiler/privacyVarDeclFile_externalModule.ts(26,23): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. @@ -28,6 +18,16 @@ tests/cases/compiler/privacyVarDeclFile_externalModule.ts(146,40): error TS4028: tests/cases/compiler/privacyVarDeclFile_externalModule.ts(147,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. tests/cases/compiler/privacyVarDeclFile_externalModule.ts(149,57): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. tests/cases/compiler/privacyVarDeclFile_externalModule.ts(150,72): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(105,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(121,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(123,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(148,51): error TS4025: Exported variable 'publicVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(153,66): error TS4025: Exported variable 'publicAmbientVarWithPrivatePropertyTypes' has or is using private name 'privateClass'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(159,21): error TS4033: Property 'myProperty' of exported interface has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(162,40): error TS4028: Public static property 'myPublicStaticProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(163,27): error TS4031: Public property 'myPublicProperty' of exported class has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(165,57): error TS4025: Exported variable 'publicVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. +tests/cases/compiler/privacyVarDeclFile_GlobalFile.ts(166,72): error TS4025: Exported variable 'publicAmbientVarWithPrivateModulePropertyTypes' has or is using private name 'privateModule'. ==== tests/cases/compiler/privacyVarDeclFile_externalModule.ts (20 errors) ==== diff --git a/tests/baselines/reference/promiseType.symbols b/tests/baselines/reference/promiseType.symbols index 5eea680f9fb7c..c1227c10353ed 100644 --- a/tests/baselines/reference/promiseType.symbols +++ b/tests/baselines/reference/promiseType.symbols @@ -1,7 +1,7 @@ === tests/cases/compiler/promiseType.ts === declare var p: Promise; >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare var x: any; >x : Symbol(x, Decl(promiseType.ts, 1, 11)) @@ -73,7 +73,7 @@ async function E() { >e : Symbol(e, Decl(promiseType.ts, 37, 11)) throw Error(); ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } @@ -91,10 +91,10 @@ async function F() { >e : Symbol(e, Decl(promiseType.ts, 47, 11)) return Promise.reject(Error()); ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } @@ -131,7 +131,7 @@ async function H() { >e : Symbol(e, Decl(promiseType.ts, 67, 11)) throw Error(); ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } @@ -150,10 +150,10 @@ async function I() { >e : Symbol(e, Decl(promiseType.ts, 77, 11)) return Promise.reject(Error()); ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } @@ -161,931 +161,931 @@ async function I() { const p00 = p.catch(); >p00 : Symbol(p00, Decl(promiseType.ts, 84, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p01 = p.then(); >p01 : Symbol(p01, Decl(promiseType.ts, 85, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p10 = p.catch(undefined); >p10 : Symbol(p10, Decl(promiseType.ts, 87, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p11 = p.catch(null); >p11 : Symbol(p11, Decl(promiseType.ts, 88, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p12 = p.catch(() => 1); >p12 : Symbol(p12, Decl(promiseType.ts, 89, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p13 = p.catch(() => x); >p13 : Symbol(p13, Decl(promiseType.ts, 90, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p14 = p.catch(() => undefined); >p14 : Symbol(p14, Decl(promiseType.ts, 91, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p15 = p.catch(() => null); >p15 : Symbol(p15, Decl(promiseType.ts, 92, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p16 = p.catch(() => {}); >p16 : Symbol(p16, Decl(promiseType.ts, 93, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p17 = p.catch(() => {throw 1}); >p17 : Symbol(p17, Decl(promiseType.ts, 94, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p18 = p.catch(() => Promise.reject(1)); >p18 : Symbol(p18, Decl(promiseType.ts, 95, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p19 = p.catch(() => Promise.resolve(1)); >p19 : Symbol(p19, Decl(promiseType.ts, 96, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p20 = p.then(undefined); >p20 : Symbol(p20, Decl(promiseType.ts, 98, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p21 = p.then(null); >p21 : Symbol(p21, Decl(promiseType.ts, 99, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p22 = p.then(() => 1); >p22 : Symbol(p22, Decl(promiseType.ts, 100, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p23 = p.then(() => x); >p23 : Symbol(p23, Decl(promiseType.ts, 101, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p24 = p.then(() => undefined); >p24 : Symbol(p24, Decl(promiseType.ts, 102, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p25 = p.then(() => null); >p25 : Symbol(p25, Decl(promiseType.ts, 103, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p26 = p.then(() => {}); >p26 : Symbol(p26, Decl(promiseType.ts, 104, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p27 = p.then(() => {throw 1}); >p27 : Symbol(p27, Decl(promiseType.ts, 105, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p28 = p.then(() => Promise.resolve(1)); >p28 : Symbol(p28, Decl(promiseType.ts, 106, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p29 = p.then(() => Promise.reject(1)); >p29 : Symbol(p29, Decl(promiseType.ts, 107, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p30 = p.then(undefined, undefined); >p30 : Symbol(p30, Decl(promiseType.ts, 109, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) const p31 = p.then(undefined, null); >p31 : Symbol(p31, Decl(promiseType.ts, 110, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p32 = p.then(undefined, () => 1); >p32 : Symbol(p32, Decl(promiseType.ts, 111, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p33 = p.then(undefined, () => x); >p33 : Symbol(p33, Decl(promiseType.ts, 112, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p34 = p.then(undefined, () => undefined); >p34 : Symbol(p34, Decl(promiseType.ts, 113, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) const p35 = p.then(undefined, () => null); >p35 : Symbol(p35, Decl(promiseType.ts, 114, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p36 = p.then(undefined, () => {}); >p36 : Symbol(p36, Decl(promiseType.ts, 115, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p37 = p.then(undefined, () => {throw 1}); >p37 : Symbol(p37, Decl(promiseType.ts, 116, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p38 = p.then(undefined, () => Promise.resolve(1)); >p38 : Symbol(p38, Decl(promiseType.ts, 117, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p39 = p.then(undefined, () => Promise.reject(1)); >p39 : Symbol(p39, Decl(promiseType.ts, 118, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p40 = p.then(null, undefined); >p40 : Symbol(p40, Decl(promiseType.ts, 120, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p41 = p.then(null, null); >p41 : Symbol(p41, Decl(promiseType.ts, 121, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p42 = p.then(null, () => 1); >p42 : Symbol(p42, Decl(promiseType.ts, 122, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p43 = p.then(null, () => x); >p43 : Symbol(p43, Decl(promiseType.ts, 123, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p44 = p.then(null, () => undefined); >p44 : Symbol(p44, Decl(promiseType.ts, 124, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p45 = p.then(null, () => null); >p45 : Symbol(p45, Decl(promiseType.ts, 125, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p46 = p.then(null, () => {}); >p46 : Symbol(p46, Decl(promiseType.ts, 126, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p47 = p.then(null, () => {throw 1}); >p47 : Symbol(p47, Decl(promiseType.ts, 127, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p48 = p.then(null, () => Promise.resolve(1)); >p48 : Symbol(p48, Decl(promiseType.ts, 128, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p49 = p.then(null, () => Promise.reject(1)); >p49 : Symbol(p49, Decl(promiseType.ts, 129, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p50 = p.then(() => "1", undefined); >p50 : Symbol(p50, Decl(promiseType.ts, 131, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p51 = p.then(() => "1", null); >p51 : Symbol(p51, Decl(promiseType.ts, 132, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p52 = p.then(() => "1", () => 1); >p52 : Symbol(p52, Decl(promiseType.ts, 133, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p53 = p.then(() => "1", () => x); >p53 : Symbol(p53, Decl(promiseType.ts, 134, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p54 = p.then(() => "1", () => undefined); >p54 : Symbol(p54, Decl(promiseType.ts, 135, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p55 = p.then(() => "1", () => null); >p55 : Symbol(p55, Decl(promiseType.ts, 136, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p56 = p.then(() => "1", () => {}); >p56 : Symbol(p56, Decl(promiseType.ts, 137, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p57 = p.then(() => "1", () => {throw 1}); >p57 : Symbol(p57, Decl(promiseType.ts, 138, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p58 = p.then(() => "1", () => Promise.resolve(1)); >p58 : Symbol(p58, Decl(promiseType.ts, 139, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p59 = p.then(() => "1", () => Promise.reject(1)); >p59 : Symbol(p59, Decl(promiseType.ts, 140, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p60 = p.then(() => x, undefined); >p60 : Symbol(p60, Decl(promiseType.ts, 142, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) >undefined : Symbol(undefined) const p61 = p.then(() => x, null); >p61 : Symbol(p61, Decl(promiseType.ts, 143, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p62 = p.then(() => x, () => 1); >p62 : Symbol(p62, Decl(promiseType.ts, 144, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p63 = p.then(() => x, () => x); >p63 : Symbol(p63, Decl(promiseType.ts, 145, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p64 = p.then(() => x, () => undefined); >p64 : Symbol(p64, Decl(promiseType.ts, 146, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) >undefined : Symbol(undefined) const p65 = p.then(() => x, () => null); >p65 : Symbol(p65, Decl(promiseType.ts, 147, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p66 = p.then(() => x, () => {}); >p66 : Symbol(p66, Decl(promiseType.ts, 148, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p67 = p.then(() => x, () => {throw 1}); >p67 : Symbol(p67, Decl(promiseType.ts, 149, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p68 = p.then(() => x, () => Promise.resolve(1)); >p68 : Symbol(p68, Decl(promiseType.ts, 150, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p69 = p.then(() => x, () => Promise.reject(1)); >p69 : Symbol(p69, Decl(promiseType.ts, 151, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p70 = p.then(() => undefined, undefined); >p70 : Symbol(p70, Decl(promiseType.ts, 153, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) const p71 = p.then(() => undefined, null); >p71 : Symbol(p71, Decl(promiseType.ts, 154, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p72 = p.then(() => undefined, () => 1); >p72 : Symbol(p72, Decl(promiseType.ts, 155, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p73 = p.then(() => undefined, () => x); >p73 : Symbol(p73, Decl(promiseType.ts, 156, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p74 = p.then(() => undefined, () => undefined); >p74 : Symbol(p74, Decl(promiseType.ts, 157, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) const p75 = p.then(() => undefined, () => null); >p75 : Symbol(p75, Decl(promiseType.ts, 158, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p76 = p.then(() => undefined, () => {}); >p76 : Symbol(p76, Decl(promiseType.ts, 159, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p77 = p.then(() => undefined, () => {throw 1}); >p77 : Symbol(p77, Decl(promiseType.ts, 160, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p78 = p.then(() => undefined, () => Promise.resolve(1)); >p78 : Symbol(p78, Decl(promiseType.ts, 161, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p79 = p.then(() => undefined, () => Promise.reject(1)); >p79 : Symbol(p79, Decl(promiseType.ts, 162, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p80 = p.then(() => null, undefined); >p80 : Symbol(p80, Decl(promiseType.ts, 164, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p81 = p.then(() => null, null); >p81 : Symbol(p81, Decl(promiseType.ts, 165, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p82 = p.then(() => null, () => 1); >p82 : Symbol(p82, Decl(promiseType.ts, 166, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p83 = p.then(() => null, () => x); >p83 : Symbol(p83, Decl(promiseType.ts, 167, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p84 = p.then(() => null, () => undefined); >p84 : Symbol(p84, Decl(promiseType.ts, 168, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p85 = p.then(() => null, () => null); >p85 : Symbol(p85, Decl(promiseType.ts, 169, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p86 = p.then(() => null, () => {}); >p86 : Symbol(p86, Decl(promiseType.ts, 170, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p87 = p.then(() => null, () => {throw 1}); >p87 : Symbol(p87, Decl(promiseType.ts, 171, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p88 = p.then(() => null, () => Promise.resolve(1)); >p88 : Symbol(p88, Decl(promiseType.ts, 172, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p89 = p.then(() => null, () => Promise.reject(1)); >p89 : Symbol(p89, Decl(promiseType.ts, 173, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p90 = p.then(() => {}, undefined); >p90 : Symbol(p90, Decl(promiseType.ts, 175, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p91 = p.then(() => {}, null); >p91 : Symbol(p91, Decl(promiseType.ts, 176, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p92 = p.then(() => {}, () => 1); >p92 : Symbol(p92, Decl(promiseType.ts, 177, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p93 = p.then(() => {}, () => x); >p93 : Symbol(p93, Decl(promiseType.ts, 178, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const p94 = p.then(() => {}, () => undefined); >p94 : Symbol(p94, Decl(promiseType.ts, 179, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p95 = p.then(() => {}, () => null); >p95 : Symbol(p95, Decl(promiseType.ts, 180, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p96 = p.then(() => {}, () => {}); >p96 : Symbol(p96, Decl(promiseType.ts, 181, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p97 = p.then(() => {}, () => {throw 1}); >p97 : Symbol(p97, Decl(promiseType.ts, 182, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p98 = p.then(() => {}, () => Promise.resolve(1)); >p98 : Symbol(p98, Decl(promiseType.ts, 183, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p99 = p.then(() => {}, () => Promise.reject(1)); >p99 : Symbol(p99, Decl(promiseType.ts, 184, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pa0 = p.then(() => {throw 1}, undefined); >pa0 : Symbol(pa0, Decl(promiseType.ts, 186, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pa1 = p.then(() => {throw 1}, null); >pa1 : Symbol(pa1, Decl(promiseType.ts, 187, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa2 = p.then(() => {throw 1}, () => 1); >pa2 : Symbol(pa2, Decl(promiseType.ts, 188, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa3 = p.then(() => {throw 1}, () => x); >pa3 : Symbol(pa3, Decl(promiseType.ts, 189, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const pa4 = p.then(() => {throw 1}, () => undefined); >pa4 : Symbol(pa4, Decl(promiseType.ts, 190, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pa5 = p.then(() => {throw 1}, () => null); >pa5 : Symbol(pa5, Decl(promiseType.ts, 191, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa6 = p.then(() => {throw 1}, () => {}); >pa6 : Symbol(pa6, Decl(promiseType.ts, 192, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa7 = p.then(() => {throw 1}, () => {throw 1}); >pa7 : Symbol(pa7, Decl(promiseType.ts, 193, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa8 = p.then(() => {throw 1}, () => Promise.resolve(1)); >pa8 : Symbol(pa8, Decl(promiseType.ts, 194, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pa9 = p.then(() => {throw 1}, () => Promise.reject(1)); >pa9 : Symbol(pa9, Decl(promiseType.ts, 195, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb0 = p.then(() => Promise.resolve("1"), undefined); >pb0 : Symbol(pb0, Decl(promiseType.ts, 197, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pb1 = p.then(() => Promise.resolve("1"), null); >pb1 : Symbol(pb1, Decl(promiseType.ts, 198, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb2 = p.then(() => Promise.resolve("1"), () => 1); >pb2 : Symbol(pb2, Decl(promiseType.ts, 199, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb3 = p.then(() => Promise.resolve("1"), () => x); >pb3 : Symbol(pb3, Decl(promiseType.ts, 200, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const pb4 = p.then(() => Promise.resolve("1"), () => undefined); >pb4 : Symbol(pb4, Decl(promiseType.ts, 201, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pb5 = p.then(() => Promise.resolve("1"), () => null); >pb5 : Symbol(pb5, Decl(promiseType.ts, 202, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb6 = p.then(() => Promise.resolve("1"), () => {}); >pb6 : Symbol(pb6, Decl(promiseType.ts, 203, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb7 = p.then(() => Promise.resolve("1"), () => {throw 1}); >pb7 : Symbol(pb7, Decl(promiseType.ts, 204, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb8 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); >pb8 : Symbol(pb8, Decl(promiseType.ts, 205, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb9 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); >pb9 : Symbol(pb9, Decl(promiseType.ts, 206, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc0 = p.then(() => Promise.reject("1"), undefined); >pc0 : Symbol(pc0, Decl(promiseType.ts, 208, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pc1 = p.then(() => Promise.reject("1"), null); >pc1 : Symbol(pc1, Decl(promiseType.ts, 209, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc2 = p.then(() => Promise.reject("1"), () => 1); >pc2 : Symbol(pc2, Decl(promiseType.ts, 210, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc3 = p.then(() => Promise.reject("1"), () => x); >pc3 : Symbol(pc3, Decl(promiseType.ts, 211, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseType.ts, 1, 11)) const pc4 = p.then(() => Promise.reject("1"), () => undefined); >pc4 : Symbol(pc4, Decl(promiseType.ts, 212, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pc5 = p.then(() => Promise.reject("1"), () => null); >pc5 : Symbol(pc5, Decl(promiseType.ts, 213, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc6 = p.then(() => Promise.reject("1"), () => {}); >pc6 : Symbol(pc6, Decl(promiseType.ts, 214, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc7 = p.then(() => Promise.reject("1"), () => {throw 1}); >pc7 : Symbol(pc7, Decl(promiseType.ts, 215, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc8 = p.then(() => Promise.reject("1"), () => Promise.resolve(1)); >pc8 : Symbol(pc8, Decl(promiseType.ts, 216, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); >pc9 : Symbol(pc9, Decl(promiseType.ts, 217, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->p : Symbol(p, Decl(promiseType.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>p : Symbol(p, Decl(promiseType.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/promiseTypeStrictNull.symbols b/tests/baselines/reference/promiseTypeStrictNull.symbols index 3fabb7f16b766..b9910bbae717d 100644 --- a/tests/baselines/reference/promiseTypeStrictNull.symbols +++ b/tests/baselines/reference/promiseTypeStrictNull.symbols @@ -1,7 +1,7 @@ === tests/cases/compiler/promiseTypeStrictNull.ts === declare var p: Promise; >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) declare var x: any; >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) @@ -73,7 +73,7 @@ async function E() { >e : Symbol(e, Decl(promiseTypeStrictNull.ts, 37, 11)) throw Error(); ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } @@ -91,10 +91,10 @@ async function F() { >e : Symbol(e, Decl(promiseTypeStrictNull.ts, 47, 11)) return Promise.reject(Error()); ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } @@ -131,7 +131,7 @@ async function H() { >e : Symbol(e, Decl(promiseTypeStrictNull.ts, 67, 11)) throw Error(); ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } @@ -150,10 +150,10 @@ async function I() { >e : Symbol(e, Decl(promiseTypeStrictNull.ts, 77, 11)) return Promise.reject(Error()); ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } } @@ -161,931 +161,931 @@ async function I() { const p00 = p.catch(); >p00 : Symbol(p00, Decl(promiseTypeStrictNull.ts, 84, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p01 = p.then(); >p01 : Symbol(p01, Decl(promiseTypeStrictNull.ts, 85, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p10 = p.catch(undefined); >p10 : Symbol(p10, Decl(promiseTypeStrictNull.ts, 87, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p11 = p.catch(null); >p11 : Symbol(p11, Decl(promiseTypeStrictNull.ts, 88, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p12 = p.catch(() => 1); >p12 : Symbol(p12, Decl(promiseTypeStrictNull.ts, 89, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p13 = p.catch(() => x); >p13 : Symbol(p13, Decl(promiseTypeStrictNull.ts, 90, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p14 = p.catch(() => undefined); >p14 : Symbol(p14, Decl(promiseTypeStrictNull.ts, 91, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p15 = p.catch(() => null); >p15 : Symbol(p15, Decl(promiseTypeStrictNull.ts, 92, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p16 = p.catch(() => {}); >p16 : Symbol(p16, Decl(promiseTypeStrictNull.ts, 93, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p17 = p.catch(() => {throw 1}); >p17 : Symbol(p17, Decl(promiseTypeStrictNull.ts, 94, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) const p18 = p.catch(() => Promise.reject(1)); >p18 : Symbol(p18, Decl(promiseTypeStrictNull.ts, 95, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p19 = p.catch(() => Promise.resolve(1)); >p19 : Symbol(p19, Decl(promiseTypeStrictNull.ts, 96, 5)) ->p.catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) +>p.catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->catch : Symbol(Promise.catch, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>catch : Symbol(Promise.catch, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p20 = p.then(undefined); >p20 : Symbol(p20, Decl(promiseTypeStrictNull.ts, 98, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p21 = p.then(null); >p21 : Symbol(p21, Decl(promiseTypeStrictNull.ts, 99, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p22 = p.then(() => 1); >p22 : Symbol(p22, Decl(promiseTypeStrictNull.ts, 100, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p23 = p.then(() => x); >p23 : Symbol(p23, Decl(promiseTypeStrictNull.ts, 101, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p24 = p.then(() => undefined); >p24 : Symbol(p24, Decl(promiseTypeStrictNull.ts, 102, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p25 = p.then(() => null); >p25 : Symbol(p25, Decl(promiseTypeStrictNull.ts, 103, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p26 = p.then(() => {}); >p26 : Symbol(p26, Decl(promiseTypeStrictNull.ts, 104, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p27 = p.then(() => {throw 1}); >p27 : Symbol(p27, Decl(promiseTypeStrictNull.ts, 105, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p28 = p.then(() => Promise.resolve(1)); >p28 : Symbol(p28, Decl(promiseTypeStrictNull.ts, 106, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p29 = p.then(() => Promise.reject(1)); >p29 : Symbol(p29, Decl(promiseTypeStrictNull.ts, 107, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p30 = p.then(undefined, undefined); >p30 : Symbol(p30, Decl(promiseTypeStrictNull.ts, 109, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) const p31 = p.then(undefined, null); >p31 : Symbol(p31, Decl(promiseTypeStrictNull.ts, 110, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p32 = p.then(undefined, () => 1); >p32 : Symbol(p32, Decl(promiseTypeStrictNull.ts, 111, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p33 = p.then(undefined, () => x); >p33 : Symbol(p33, Decl(promiseTypeStrictNull.ts, 112, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p34 = p.then(undefined, () => undefined); >p34 : Symbol(p34, Decl(promiseTypeStrictNull.ts, 113, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) const p35 = p.then(undefined, () => null); >p35 : Symbol(p35, Decl(promiseTypeStrictNull.ts, 114, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p36 = p.then(undefined, () => {}); >p36 : Symbol(p36, Decl(promiseTypeStrictNull.ts, 115, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p37 = p.then(undefined, () => {throw 1}); >p37 : Symbol(p37, Decl(promiseTypeStrictNull.ts, 116, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p38 = p.then(undefined, () => Promise.resolve(1)); >p38 : Symbol(p38, Decl(promiseTypeStrictNull.ts, 117, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p39 = p.then(undefined, () => Promise.reject(1)); >p39 : Symbol(p39, Decl(promiseTypeStrictNull.ts, 118, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p40 = p.then(null, undefined); >p40 : Symbol(p40, Decl(promiseTypeStrictNull.ts, 120, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p41 = p.then(null, null); >p41 : Symbol(p41, Decl(promiseTypeStrictNull.ts, 121, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p42 = p.then(null, () => 1); >p42 : Symbol(p42, Decl(promiseTypeStrictNull.ts, 122, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p43 = p.then(null, () => x); >p43 : Symbol(p43, Decl(promiseTypeStrictNull.ts, 123, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p44 = p.then(null, () => undefined); >p44 : Symbol(p44, Decl(promiseTypeStrictNull.ts, 124, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p45 = p.then(null, () => null); >p45 : Symbol(p45, Decl(promiseTypeStrictNull.ts, 125, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p46 = p.then(null, () => {}); >p46 : Symbol(p46, Decl(promiseTypeStrictNull.ts, 126, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p47 = p.then(null, () => {throw 1}); >p47 : Symbol(p47, Decl(promiseTypeStrictNull.ts, 127, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p48 = p.then(null, () => Promise.resolve(1)); >p48 : Symbol(p48, Decl(promiseTypeStrictNull.ts, 128, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p49 = p.then(null, () => Promise.reject(1)); >p49 : Symbol(p49, Decl(promiseTypeStrictNull.ts, 129, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p50 = p.then(() => "1", undefined); >p50 : Symbol(p50, Decl(promiseTypeStrictNull.ts, 131, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p51 = p.then(() => "1", null); >p51 : Symbol(p51, Decl(promiseTypeStrictNull.ts, 132, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p52 = p.then(() => "1", () => 1); >p52 : Symbol(p52, Decl(promiseTypeStrictNull.ts, 133, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p53 = p.then(() => "1", () => x); >p53 : Symbol(p53, Decl(promiseTypeStrictNull.ts, 134, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p54 = p.then(() => "1", () => undefined); >p54 : Symbol(p54, Decl(promiseTypeStrictNull.ts, 135, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p55 = p.then(() => "1", () => null); >p55 : Symbol(p55, Decl(promiseTypeStrictNull.ts, 136, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p56 = p.then(() => "1", () => {}); >p56 : Symbol(p56, Decl(promiseTypeStrictNull.ts, 137, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p57 = p.then(() => "1", () => {throw 1}); >p57 : Symbol(p57, Decl(promiseTypeStrictNull.ts, 138, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p58 = p.then(() => "1", () => Promise.resolve(1)); >p58 : Symbol(p58, Decl(promiseTypeStrictNull.ts, 139, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p59 = p.then(() => "1", () => Promise.reject(1)); >p59 : Symbol(p59, Decl(promiseTypeStrictNull.ts, 140, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p60 = p.then(() => x, undefined); >p60 : Symbol(p60, Decl(promiseTypeStrictNull.ts, 142, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) >undefined : Symbol(undefined) const p61 = p.then(() => x, null); >p61 : Symbol(p61, Decl(promiseTypeStrictNull.ts, 143, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p62 = p.then(() => x, () => 1); >p62 : Symbol(p62, Decl(promiseTypeStrictNull.ts, 144, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p63 = p.then(() => x, () => x); >p63 : Symbol(p63, Decl(promiseTypeStrictNull.ts, 145, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p64 = p.then(() => x, () => undefined); >p64 : Symbol(p64, Decl(promiseTypeStrictNull.ts, 146, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) >undefined : Symbol(undefined) const p65 = p.then(() => x, () => null); >p65 : Symbol(p65, Decl(promiseTypeStrictNull.ts, 147, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p66 = p.then(() => x, () => {}); >p66 : Symbol(p66, Decl(promiseTypeStrictNull.ts, 148, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p67 = p.then(() => x, () => {throw 1}); >p67 : Symbol(p67, Decl(promiseTypeStrictNull.ts, 149, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p68 = p.then(() => x, () => Promise.resolve(1)); >p68 : Symbol(p68, Decl(promiseTypeStrictNull.ts, 150, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p69 = p.then(() => x, () => Promise.reject(1)); >p69 : Symbol(p69, Decl(promiseTypeStrictNull.ts, 151, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p70 = p.then(() => undefined, undefined); >p70 : Symbol(p70, Decl(promiseTypeStrictNull.ts, 153, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) const p71 = p.then(() => undefined, null); >p71 : Symbol(p71, Decl(promiseTypeStrictNull.ts, 154, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p72 = p.then(() => undefined, () => 1); >p72 : Symbol(p72, Decl(promiseTypeStrictNull.ts, 155, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p73 = p.then(() => undefined, () => x); >p73 : Symbol(p73, Decl(promiseTypeStrictNull.ts, 156, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p74 = p.then(() => undefined, () => undefined); >p74 : Symbol(p74, Decl(promiseTypeStrictNull.ts, 157, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) >undefined : Symbol(undefined) const p75 = p.then(() => undefined, () => null); >p75 : Symbol(p75, Decl(promiseTypeStrictNull.ts, 158, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p76 = p.then(() => undefined, () => {}); >p76 : Symbol(p76, Decl(promiseTypeStrictNull.ts, 159, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p77 = p.then(() => undefined, () => {throw 1}); >p77 : Symbol(p77, Decl(promiseTypeStrictNull.ts, 160, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p78 = p.then(() => undefined, () => Promise.resolve(1)); >p78 : Symbol(p78, Decl(promiseTypeStrictNull.ts, 161, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p79 = p.then(() => undefined, () => Promise.reject(1)); >p79 : Symbol(p79, Decl(promiseTypeStrictNull.ts, 162, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p80 = p.then(() => null, undefined); >p80 : Symbol(p80, Decl(promiseTypeStrictNull.ts, 164, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p81 = p.then(() => null, null); >p81 : Symbol(p81, Decl(promiseTypeStrictNull.ts, 165, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p82 = p.then(() => null, () => 1); >p82 : Symbol(p82, Decl(promiseTypeStrictNull.ts, 166, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p83 = p.then(() => null, () => x); >p83 : Symbol(p83, Decl(promiseTypeStrictNull.ts, 167, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p84 = p.then(() => null, () => undefined); >p84 : Symbol(p84, Decl(promiseTypeStrictNull.ts, 168, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p85 = p.then(() => null, () => null); >p85 : Symbol(p85, Decl(promiseTypeStrictNull.ts, 169, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p86 = p.then(() => null, () => {}); >p86 : Symbol(p86, Decl(promiseTypeStrictNull.ts, 170, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p87 = p.then(() => null, () => {throw 1}); >p87 : Symbol(p87, Decl(promiseTypeStrictNull.ts, 171, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p88 = p.then(() => null, () => Promise.resolve(1)); >p88 : Symbol(p88, Decl(promiseTypeStrictNull.ts, 172, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p89 = p.then(() => null, () => Promise.reject(1)); >p89 : Symbol(p89, Decl(promiseTypeStrictNull.ts, 173, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p90 = p.then(() => {}, undefined); >p90 : Symbol(p90, Decl(promiseTypeStrictNull.ts, 175, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p91 = p.then(() => {}, null); >p91 : Symbol(p91, Decl(promiseTypeStrictNull.ts, 176, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p92 = p.then(() => {}, () => 1); >p92 : Symbol(p92, Decl(promiseTypeStrictNull.ts, 177, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p93 = p.then(() => {}, () => x); >p93 : Symbol(p93, Decl(promiseTypeStrictNull.ts, 178, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const p94 = p.then(() => {}, () => undefined); >p94 : Symbol(p94, Decl(promiseTypeStrictNull.ts, 179, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const p95 = p.then(() => {}, () => null); >p95 : Symbol(p95, Decl(promiseTypeStrictNull.ts, 180, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p96 = p.then(() => {}, () => {}); >p96 : Symbol(p96, Decl(promiseTypeStrictNull.ts, 181, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p97 = p.then(() => {}, () => {throw 1}); >p97 : Symbol(p97, Decl(promiseTypeStrictNull.ts, 182, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const p98 = p.then(() => {}, () => Promise.resolve(1)); >p98 : Symbol(p98, Decl(promiseTypeStrictNull.ts, 183, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const p99 = p.then(() => {}, () => Promise.reject(1)); >p99 : Symbol(p99, Decl(promiseTypeStrictNull.ts, 184, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pa0 = p.then(() => {throw 1}, undefined); >pa0 : Symbol(pa0, Decl(promiseTypeStrictNull.ts, 186, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pa1 = p.then(() => {throw 1}, null); >pa1 : Symbol(pa1, Decl(promiseTypeStrictNull.ts, 187, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa2 = p.then(() => {throw 1}, () => 1); >pa2 : Symbol(pa2, Decl(promiseTypeStrictNull.ts, 188, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa3 = p.then(() => {throw 1}, () => x); >pa3 : Symbol(pa3, Decl(promiseTypeStrictNull.ts, 189, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const pa4 = p.then(() => {throw 1}, () => undefined); >pa4 : Symbol(pa4, Decl(promiseTypeStrictNull.ts, 190, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pa5 = p.then(() => {throw 1}, () => null); >pa5 : Symbol(pa5, Decl(promiseTypeStrictNull.ts, 191, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa6 = p.then(() => {throw 1}, () => {}); >pa6 : Symbol(pa6, Decl(promiseTypeStrictNull.ts, 192, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa7 = p.then(() => {throw 1}, () => {throw 1}); >pa7 : Symbol(pa7, Decl(promiseTypeStrictNull.ts, 193, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) const pa8 = p.then(() => {throw 1}, () => Promise.resolve(1)); >pa8 : Symbol(pa8, Decl(promiseTypeStrictNull.ts, 194, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pa9 = p.then(() => {throw 1}, () => Promise.reject(1)); >pa9 : Symbol(pa9, Decl(promiseTypeStrictNull.ts, 195, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb0 = p.then(() => Promise.resolve("1"), undefined); >pb0 : Symbol(pb0, Decl(promiseTypeStrictNull.ts, 197, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pb1 = p.then(() => Promise.resolve("1"), null); >pb1 : Symbol(pb1, Decl(promiseTypeStrictNull.ts, 198, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb2 = p.then(() => Promise.resolve("1"), () => 1); >pb2 : Symbol(pb2, Decl(promiseTypeStrictNull.ts, 199, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb3 = p.then(() => Promise.resolve("1"), () => x); >pb3 : Symbol(pb3, Decl(promiseTypeStrictNull.ts, 200, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const pb4 = p.then(() => Promise.resolve("1"), () => undefined); >pb4 : Symbol(pb4, Decl(promiseTypeStrictNull.ts, 201, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pb5 = p.then(() => Promise.resolve("1"), () => null); >pb5 : Symbol(pb5, Decl(promiseTypeStrictNull.ts, 202, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb6 = p.then(() => Promise.resolve("1"), () => {}); >pb6 : Symbol(pb6, Decl(promiseTypeStrictNull.ts, 203, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb7 = p.then(() => Promise.resolve("1"), () => {throw 1}); >pb7 : Symbol(pb7, Decl(promiseTypeStrictNull.ts, 204, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb8 = p.then(() => Promise.resolve("1"), () => Promise.resolve(1)); >pb8 : Symbol(pb8, Decl(promiseTypeStrictNull.ts, 205, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pb9 = p.then(() => Promise.resolve("1"), () => Promise.reject(1)); >pb9 : Symbol(pb9, Decl(promiseTypeStrictNull.ts, 206, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc0 = p.then(() => Promise.reject("1"), undefined); >pc0 : Symbol(pc0, Decl(promiseTypeStrictNull.ts, 208, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pc1 = p.then(() => Promise.reject("1"), null); >pc1 : Symbol(pc1, Decl(promiseTypeStrictNull.ts, 209, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc2 = p.then(() => Promise.reject("1"), () => 1); >pc2 : Symbol(pc2, Decl(promiseTypeStrictNull.ts, 210, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc3 = p.then(() => Promise.reject("1"), () => x); >pc3 : Symbol(pc3, Decl(promiseTypeStrictNull.ts, 211, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseTypeStrictNull.ts, 1, 11)) const pc4 = p.then(() => Promise.reject("1"), () => undefined); >pc4 : Symbol(pc4, Decl(promiseTypeStrictNull.ts, 212, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) const pc5 = p.then(() => Promise.reject("1"), () => null); >pc5 : Symbol(pc5, Decl(promiseTypeStrictNull.ts, 213, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc6 = p.then(() => Promise.reject("1"), () => {}); >pc6 : Symbol(pc6, Decl(promiseTypeStrictNull.ts, 214, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc7 = p.then(() => Promise.reject("1"), () => {throw 1}); >pc7 : Symbol(pc7, Decl(promiseTypeStrictNull.ts, 215, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc8 = p.then(() => Promise.reject("1"), () => Promise.resolve(1)); >pc8 : Symbol(pc8, Decl(promiseTypeStrictNull.ts, 216, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) const pc9 = p.then(() => Promise.reject("1"), () => Promise.reject(1)); >pc9 : Symbol(pc9, Decl(promiseTypeStrictNull.ts, 217, 5)) ->p.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->reject : Symbol(PromiseConstructor.reject, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>p.then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>p : Symbol(p, Decl(promiseTypeStrictNull.ts, 0, 11)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise.reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>reject : Symbol(PromiseConstructor.reject, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/promiseVoidErrorCallback.symbols b/tests/baselines/reference/promiseVoidErrorCallback.symbols index 184ffd32592af..c923ea234d8f8 100644 --- a/tests/baselines/reference/promiseVoidErrorCallback.symbols +++ b/tests/baselines/reference/promiseVoidErrorCallback.symbols @@ -22,13 +22,13 @@ interface T3 { function f1(): Promise { >f1 : Symbol(f1, Decl(promiseVoidErrorCallback.ts, 10, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >T1 : Symbol(T1, Decl(promiseVoidErrorCallback.ts, 0, 0)) return Promise.resolve({ __t1: "foo_t1" }); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->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, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >__t1 : Symbol(__t1, Decl(promiseVoidErrorCallback.ts, 13, 28)) } @@ -47,22 +47,22 @@ function f2(x: T1): T2 { var x3 = f1() >x3 : Symbol(x3, Decl(promiseVoidErrorCallback.ts, 20, 3)) ->f1() .then(f2, (e: Error) => { throw e;}) .then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) ->f1() .then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>f1() .then(f2, (e: Error) => { throw e;}) .then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) +>f1() .then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >f1 : Symbol(f1, Decl(promiseVoidErrorCallback.ts, 10, 1)) .then(f2, (e: Error) => { ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >f2 : Symbol(f2, Decl(promiseVoidErrorCallback.ts, 14, 1)) >e : Symbol(e, Decl(promiseVoidErrorCallback.ts, 21, 15)) ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Error : Symbol(Error, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) throw e; >e : Symbol(e, Decl(promiseVoidErrorCallback.ts, 21, 15)) }) .then((x: T2) => { ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(promiseVoidErrorCallback.ts, 24, 11)) >T2 : Symbol(T2, Decl(promiseVoidErrorCallback.ts, 2, 1)) diff --git a/tests/baselines/reference/propertyAccessNumericLiterals.es6.symbols b/tests/baselines/reference/propertyAccessNumericLiterals.es6.symbols index dc0be21d84f62..36544cc1c4000 100644 --- a/tests/baselines/reference/propertyAccessNumericLiterals.es6.symbols +++ b/tests/baselines/reference/propertyAccessNumericLiterals.es6.symbols @@ -1,21 +1,21 @@ === tests/cases/conformance/es6/propertyAccess/propertyAccessNumericLiterals.es6.ts === 0xffffffff.toString(); ->0xffffffff.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>0xffffffff.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) 0o01234.toString(); ->0o01234.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>0o01234.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) 0b01101101.toString(); ->0b01101101.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>0b01101101.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) 1234..toString(); ->1234..toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>1234..toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) 1e0.toString(); ->1e0.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) ->toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) +>1e0.toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) +>toString : Symbol(Number.toString, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.symbols b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.symbols index 6fbb89f00de05..4fba225083349 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.symbols +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.symbols @@ -5,7 +5,7 @@ class C { >C : Symbol(C, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 0, 0)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 3, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) f() { >f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 3, 25)) @@ -31,13 +31,13 @@ var r = (new C()).f(); >r : Symbol(r, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 11, 3)) >(new C()).f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 3, 25)) >C : Symbol(C, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 3, 25)) interface I { >I : Symbol(I, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 11, 28)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 13, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: T; >foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 13, 29)) @@ -46,7 +46,7 @@ interface I { var i: I; >i : Symbol(i, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 16, 3)) >I : Symbol(I, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 11, 28)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r2 = i.foo.getDate(); >r2 : Symbol(r2, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 17, 3)) @@ -68,14 +68,14 @@ var a: { (): T; >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 21, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 21, 5)) } var r3 = a().getDate(); >r3 : Symbol(r3, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 23, 3)) >a().getDate : Symbol(Date.getDate, Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 20, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >getDate : Symbol(Date.getDate, Decl(lib.d.ts, --, --)) var r3b = a()['getDate'](); @@ -89,7 +89,7 @@ var b = { foo: (x: T) => { >foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 26, 9)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 27, 10)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 27, 26)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 27, 10)) @@ -111,5 +111,5 @@ var r4 = b.foo(new Date()); >b.foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 26, 9)) >b : Symbol(b, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 26, 3)) >foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints.ts, 26, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.symbols b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.symbols index aafc8da5d2c86..ebd33d4dcc11c 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.symbols +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.symbols @@ -2,7 +2,7 @@ class C { >C : Symbol(C, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 0, 0)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 0, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) f() { >f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 0, 25)) @@ -25,13 +25,13 @@ var r = (new C()).f(); >r : Symbol(r, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 8, 3)) >(new C()).f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 0, 25)) >C : Symbol(C, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 0, 25)) interface I { >I : Symbol(I, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 8, 28)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 10, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: T; >foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 10, 29)) @@ -40,7 +40,7 @@ interface I { var i: I; >i : Symbol(i, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 13, 3)) >I : Symbol(I, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 8, 28)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r2 = i.foo.notHere(); >r2 : Symbol(r2, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 14, 3)) @@ -59,7 +59,7 @@ var a: { (): T; >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 18, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 18, 5)) } var r3: string = a().notHere(); @@ -76,7 +76,7 @@ var b = { foo: (x: T): T => { >foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 23, 9)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 24, 10)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 24, 26)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 24, 10)) >T : Symbol(T, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 24, 10)) @@ -98,5 +98,5 @@ var b = { var r4 = b.foo(new Date()); >r4 : Symbol(r4, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 31, 3)) >b : Symbol(b, Decl(propertyAccessOnTypeParameterWithConstraints4.ts, 23, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.symbols b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.symbols index d3123c0e8ba0c..1133cf38daa71 100644 --- a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.symbols +++ b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.symbols @@ -1,6 +1,6 @@ === tests/cases/compiler/reachabilityCheckWithEmptyDefault.ts === declare function print(s: string): void; ->print : Symbol(print, Decl(reachabilityCheckWithEmptyDefault.ts, 0, 0)) +>print : Symbol(print, Decl(lib.d.ts, --, --), Decl(reachabilityCheckWithEmptyDefault.ts, 0, 0)) >s : Symbol(s, Decl(reachabilityCheckWithEmptyDefault.ts, 0, 23)) function foo(x: any) { @@ -14,5 +14,5 @@ function foo(x: any) { default: } print('1'); ->print : Symbol(print, Decl(reachabilityCheckWithEmptyDefault.ts, 0, 0)) +>print : Symbol(print, Decl(lib.d.ts, --, --), Decl(reachabilityCheckWithEmptyDefault.ts, 0, 0)) } diff --git a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types index 72c23eae9720b..1125a2cd88a15 100644 --- a/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types +++ b/tests/baselines/reference/reachabilityCheckWithEmptyDefault.types @@ -1,6 +1,6 @@ === tests/cases/compiler/reachabilityCheckWithEmptyDefault.ts === declare function print(s: string): void; ->print : (s: string) => void +>print : { (): void; (s: string): void; } >s : string function foo(x: any) { @@ -17,6 +17,6 @@ function foo(x: any) { } print('1'); >print('1') : void ->print : (s: string) => void +>print : { (): void; (s: string): void; } >'1' : "1" } diff --git a/tests/baselines/reference/reachabilityChecks7.symbols b/tests/baselines/reference/reachabilityChecks7.symbols index c1b317c12f281..1a2e1d01f578c 100644 --- a/tests/baselines/reference/reachabilityChecks7.symbols +++ b/tests/baselines/reference/reachabilityChecks7.symbols @@ -11,7 +11,7 @@ let x = async function() { // async function with which promised type is void - return can be omitted async function f2(): Promise { >f2 : Symbol(f2, Decl(reachabilityChecks7.ts, 5, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } @@ -25,7 +25,7 @@ async function f3(x) { async function f4(): Promise { >f4 : Symbol(f4, Decl(reachabilityChecks7.ts, 14, 1)) ->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, --, --)) +>Promise : Symbol(Promise, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/restParametersOfNonArrayTypes.symbols b/tests/baselines/reference/restParametersOfNonArrayTypes.symbols index c7405c7c6ff7d..ff0351a5866be 100644 --- a/tests/baselines/reference/restParametersOfNonArrayTypes.symbols +++ b/tests/baselines/reference/restParametersOfNonArrayTypes.symbols @@ -13,7 +13,7 @@ var f = function foo(...x: number) { } var f2 = (...x: Date, ...y: boolean) => { } >f2 : Symbol(f2, Decl(restParametersOfNonArrayTypes.ts, 4, 3)) >x : Symbol(x, Decl(restParametersOfNonArrayTypes.ts, 4, 10)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(restParametersOfNonArrayTypes.ts, 4, 21)) class C { @@ -60,7 +60,7 @@ var b = { >foo : Symbol(foo, Decl(restParametersOfNonArrayTypes.ts, 22, 6)) >x : Symbol(x, Decl(restParametersOfNonArrayTypes.ts, 22, 20)) >y : Symbol(y, Decl(restParametersOfNonArrayTypes.ts, 22, 33)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) b: (...x: string) => { } >b : Symbol(b, Decl(restParametersOfNonArrayTypes.ts, 22, 50)) diff --git a/tests/baselines/reference/returnStatements.symbols b/tests/baselines/reference/returnStatements.symbols index af8aa2af7df30..65e9069418464 100644 --- a/tests/baselines/reference/returnStatements.symbols +++ b/tests/baselines/reference/returnStatements.symbols @@ -18,8 +18,8 @@ function fn5(): boolean { return true; } function fn6(): Date { return new Date(12); } >fn6 : Symbol(fn6, Decl(returnStatements.ts, 5, 40)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function fn7(): any { return null; } >fn7 : Symbol(fn7, Decl(returnStatements.ts, 6, 45)) diff --git a/tests/baselines/reference/scopeResolutionIdentifiers.symbols b/tests/baselines/reference/scopeResolutionIdentifiers.symbols index ecabe30534ebe..d0e2e41c82d60 100644 --- a/tests/baselines/reference/scopeResolutionIdentifiers.symbols +++ b/tests/baselines/reference/scopeResolutionIdentifiers.symbols @@ -51,7 +51,7 @@ class C { s: Date; >s : Symbol(C.s, Decl(scopeResolutionIdentifiers.ts, 21, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) n = this.s; >n : Symbol(C.n, Decl(scopeResolutionIdentifiers.ts, 22, 12)) @@ -70,7 +70,7 @@ class C { var p: Date; >p : Symbol(p, Decl(scopeResolutionIdentifiers.ts, 25, 11), Decl(scopeResolutionIdentifiers.ts, 26, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } } diff --git a/tests/baselines/reference/sourceMapValidationFor.errors.txt b/tests/baselines/reference/sourceMapValidationFor.errors.txt index c64544c4b6cf9..ffc981648d696 100644 --- a/tests/baselines/reference/sourceMapValidationFor.errors.txt +++ b/tests/baselines/reference/sourceMapValidationFor.errors.txt @@ -1,20 +1,14 @@ -tests/cases/compiler/sourceMapValidationFor.ts(2,5): error TS2304: Cannot find name 'WScript'. -tests/cases/compiler/sourceMapValidationFor.ts(6,5): error TS2304: Cannot find name 'WScript'. tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable code detected. tests/cases/compiler/sourceMapValidationFor.ts(32,21): error TS2695: Left side of comma operator is unused and has no side effects. -==== tests/cases/compiler/sourceMapValidationFor.ts (4 errors) ==== +==== tests/cases/compiler/sourceMapValidationFor.ts (2 errors) ==== for (var i = 0; i < 10; i++) { WScript.Echo("i: " + i); - ~~~~~~~ -!!! error TS2304: Cannot find name 'WScript'. } for (i = 0; i < 10; i++) { WScript.Echo("i: " + i); - ~~~~~~~ -!!! error TS2304: Cannot find name 'WScript'. } for (var j = 0; j < 10; ) { j++; diff --git a/tests/baselines/reference/sourceMapValidationFor.symbols b/tests/baselines/reference/sourceMapValidationFor.symbols index 966f905ae5d78..c9031f54cec0a 100644 --- a/tests/baselines/reference/sourceMapValidationFor.symbols +++ b/tests/baselines/reference/sourceMapValidationFor.symbols @@ -5,6 +5,9 @@ for (var i = 0; i < 10; i++) { >i : Symbol(i, Decl(sourceMapValidationFor.ts, 0, 8)) WScript.Echo("i: " + i); +>WScript.Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) +>WScript : Symbol(WScript, Decl(lib.d.ts, --, --)) +>Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) >i : Symbol(i, Decl(sourceMapValidationFor.ts, 0, 8)) } for (i = 0; i < 10; i++) @@ -13,6 +16,9 @@ for (i = 0; i < 10; i++) >i : Symbol(i, Decl(sourceMapValidationFor.ts, 0, 8)) { WScript.Echo("i: " + i); +>WScript.Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) +>WScript : Symbol(WScript, Decl(lib.d.ts, --, --)) +>Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) >i : Symbol(i, Decl(sourceMapValidationFor.ts, 0, 8)) } for (var j = 0; j < 10; ) { diff --git a/tests/baselines/reference/sourceMapValidationFor.types b/tests/baselines/reference/sourceMapValidationFor.types index 72384afb16822..896991f850ca8 100644 --- a/tests/baselines/reference/sourceMapValidationFor.types +++ b/tests/baselines/reference/sourceMapValidationFor.types @@ -9,10 +9,10 @@ for (var i = 0; i < 10; i++) { >i : number WScript.Echo("i: " + i); ->WScript.Echo("i: " + i) : any ->WScript.Echo : any ->WScript : any ->Echo : any +>WScript.Echo("i: " + i) : void +>WScript.Echo : (s: any) => void +>WScript : { Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number): number; BuildVersion: number; FullName: string; Interactive: boolean; Name: string; Path: string; ScriptName: string; StdIn: TextStreamReader; Version: string; ConnectObject(objEventSource: any, strPrefix: string): void; CreateObject(strProgID: string, strPrefix?: string): any; DisconnectObject(obj: any): void; GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; Sleep(intTime: number): void; } +>Echo : (s: any) => void >"i: " + i : string >"i: " : "i: " >i : number @@ -28,10 +28,10 @@ for (i = 0; i < 10; i++) >i : number { WScript.Echo("i: " + i); ->WScript.Echo("i: " + i) : any ->WScript.Echo : any ->WScript : any ->Echo : any +>WScript.Echo("i: " + i) : void +>WScript.Echo : (s: any) => void +>WScript : { Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number): number; BuildVersion: number; FullName: string; Interactive: boolean; Name: string; Path: string; ScriptName: string; StdIn: TextStreamReader; Version: string; ConnectObject(objEventSource: any, strPrefix: string): void; CreateObject(strProgID: string, strPrefix?: string): any; DisconnectObject(obj: any): void; GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; Sleep(intTime: number): void; } +>Echo : (s: any) => void >"i: " + i : string >"i: " : "i: " >i : number diff --git a/tests/baselines/reference/sourceMapValidationForIn.errors.txt b/tests/baselines/reference/sourceMapValidationForIn.errors.txt deleted file mode 100644 index 018d1b795dcb4..0000000000000 --- a/tests/baselines/reference/sourceMapValidationForIn.errors.txt +++ /dev/null @@ -1,29 +0,0 @@ -tests/cases/compiler/sourceMapValidationForIn.ts(2,5): error TS2304: Cannot find name 'WScript'. -tests/cases/compiler/sourceMapValidationForIn.ts(5,5): error TS2304: Cannot find name 'WScript'. -tests/cases/compiler/sourceMapValidationForIn.ts(9,5): error TS2304: Cannot find name 'WScript'. -tests/cases/compiler/sourceMapValidationForIn.ts(13,5): error TS2304: Cannot find name 'WScript'. - - -==== tests/cases/compiler/sourceMapValidationForIn.ts (4 errors) ==== - for (var x in String) { - WScript.Echo(x); - ~~~~~~~ -!!! error TS2304: Cannot find name 'WScript'. - } - for (x in String) { - WScript.Echo(x); - ~~~~~~~ -!!! error TS2304: Cannot find name 'WScript'. - } - for (var x2 in String) - { - WScript.Echo(x2); - ~~~~~~~ -!!! error TS2304: Cannot find name 'WScript'. - } - for (x in String) - { - WScript.Echo(x); - ~~~~~~~ -!!! error TS2304: Cannot find name 'WScript'. - } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationForIn.symbols b/tests/baselines/reference/sourceMapValidationForIn.symbols index ce9444d28ab9b..89edde365df53 100644 --- a/tests/baselines/reference/sourceMapValidationForIn.symbols +++ b/tests/baselines/reference/sourceMapValidationForIn.symbols @@ -4,6 +4,9 @@ for (var x in String) { >String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) WScript.Echo(x); +>WScript.Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) +>WScript : Symbol(WScript, Decl(lib.d.ts, --, --)) +>Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(sourceMapValidationForIn.ts, 0, 8)) } for (x in String) { @@ -11,6 +14,9 @@ for (x in String) { >String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) WScript.Echo(x); +>WScript.Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) +>WScript : Symbol(WScript, Decl(lib.d.ts, --, --)) +>Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(sourceMapValidationForIn.ts, 0, 8)) } for (var x2 in String) @@ -18,6 +24,9 @@ for (var x2 in String) >String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) { WScript.Echo(x2); +>WScript.Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) +>WScript : Symbol(WScript, Decl(lib.d.ts, --, --)) +>Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) >x2 : Symbol(x2, Decl(sourceMapValidationForIn.ts, 6, 8)) } for (x in String) @@ -25,5 +34,8 @@ for (x in String) >String : Symbol(String, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) { WScript.Echo(x); +>WScript.Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) +>WScript : Symbol(WScript, Decl(lib.d.ts, --, --)) +>Echo : Symbol(Echo, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(sourceMapValidationForIn.ts, 0, 8)) } diff --git a/tests/baselines/reference/sourceMapValidationForIn.types b/tests/baselines/reference/sourceMapValidationForIn.types index da4bb29f9b8a1..7fc1fb7d413c3 100644 --- a/tests/baselines/reference/sourceMapValidationForIn.types +++ b/tests/baselines/reference/sourceMapValidationForIn.types @@ -4,10 +4,10 @@ for (var x in String) { >String : StringConstructor WScript.Echo(x); ->WScript.Echo(x) : any ->WScript.Echo : any ->WScript : any ->Echo : any +>WScript.Echo(x) : void +>WScript.Echo : (s: any) => void +>WScript : { Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number): number; BuildVersion: number; FullName: string; Interactive: boolean; Name: string; Path: string; ScriptName: string; StdIn: TextStreamReader; Version: string; ConnectObject(objEventSource: any, strPrefix: string): void; CreateObject(strProgID: string, strPrefix?: string): any; DisconnectObject(obj: any): void; GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; Sleep(intTime: number): void; } +>Echo : (s: any) => void >x : string } for (x in String) { @@ -15,10 +15,10 @@ for (x in String) { >String : StringConstructor WScript.Echo(x); ->WScript.Echo(x) : any ->WScript.Echo : any ->WScript : any ->Echo : any +>WScript.Echo(x) : void +>WScript.Echo : (s: any) => void +>WScript : { Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number): number; BuildVersion: number; FullName: string; Interactive: boolean; Name: string; Path: string; ScriptName: string; StdIn: TextStreamReader; Version: string; ConnectObject(objEventSource: any, strPrefix: string): void; CreateObject(strProgID: string, strPrefix?: string): any; DisconnectObject(obj: any): void; GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; Sleep(intTime: number): void; } +>Echo : (s: any) => void >x : string } for (var x2 in String) @@ -26,10 +26,10 @@ for (var x2 in String) >String : StringConstructor { WScript.Echo(x2); ->WScript.Echo(x2) : any ->WScript.Echo : any ->WScript : any ->Echo : any +>WScript.Echo(x2) : void +>WScript.Echo : (s: any) => void +>WScript : { Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number): number; BuildVersion: number; FullName: string; Interactive: boolean; Name: string; Path: string; ScriptName: string; StdIn: TextStreamReader; Version: string; ConnectObject(objEventSource: any, strPrefix: string): void; CreateObject(strProgID: string, strPrefix?: string): any; DisconnectObject(obj: any): void; GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; Sleep(intTime: number): void; } +>Echo : (s: any) => void >x2 : string } for (x in String) @@ -37,9 +37,9 @@ for (x in String) >String : StringConstructor { WScript.Echo(x); ->WScript.Echo(x) : any ->WScript.Echo : any ->WScript : any ->Echo : any +>WScript.Echo(x) : void +>WScript.Echo : (s: any) => void +>WScript : { Echo(s: any): void; StdErr: TextStreamWriter; StdOut: TextStreamWriter; Arguments: { length: number; Item(n: number): string; }; ScriptFullName: string; Quit(exitCode?: number): number; BuildVersion: number; FullName: string; Interactive: boolean; Name: string; Path: string; ScriptName: string; StdIn: TextStreamReader; Version: string; ConnectObject(objEventSource: any, strPrefix: string): void; CreateObject(strProgID: string, strPrefix?: string): any; DisconnectObject(obj: any): void; GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any; Sleep(intTime: number): void; } +>Echo : (s: any) => void >x : string } diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.symbols b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.symbols index f262fb437819a..4d16c332d82ce 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.symbols +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.symbols @@ -6,10 +6,10 @@ module M { >X : Symbol(X, Decl(a.ts, 1, 14)) } interface Navigator { ->Navigator : Symbol(Navigator, Decl(a.ts, 2, 1)) +>Navigator : Symbol(Navigator, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(a.ts, 2, 1)) getGamepads(func?: any): any; ->getGamepads : Symbol(Navigator.getGamepads, Decl(a.ts, 3, 21)) +>getGamepads : Symbol(Navigator.getGamepads, Decl(lib.d.ts, --, --), Decl(a.ts, 3, 21)) >func : Symbol(func, Decl(a.ts, 4, 16)) webkitGetGamepads(func?: any): any diff --git a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types index d3a26c4114e9e..6fbbe7d6fc566 100644 --- a/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types +++ b/tests/baselines/reference/sourceMapWithMultipleFilesWithFileEndingWithInterface.types @@ -10,7 +10,7 @@ interface Navigator { >Navigator : Navigator getGamepads(func?: any): any; ->getGamepads : (func?: any) => any +>getGamepads : { (): Gamepad[]; (func?: any): any; } >func : any webkitGetGamepads(func?: any): any diff --git a/tests/baselines/reference/staticMembersUsingClassTypeParameter.symbols b/tests/baselines/reference/staticMembersUsingClassTypeParameter.symbols index df80c94fb9f2b..862f651c97118 100644 --- a/tests/baselines/reference/staticMembersUsingClassTypeParameter.symbols +++ b/tests/baselines/reference/staticMembersUsingClassTypeParameter.symbols @@ -28,7 +28,7 @@ class C2 { class C3 { >C3 : Symbol(C3, Decl(staticMembersUsingClassTypeParameter.ts, 9, 1)) >T : Symbol(T, Decl(staticMembersUsingClassTypeParameter.ts, 11, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) static x: T; >x : Symbol(C3.x, Decl(staticMembersUsingClassTypeParameter.ts, 11, 26)) diff --git a/tests/baselines/reference/stringIncludes.symbols b/tests/baselines/reference/stringIncludes.symbols index ba3c5ade73edb..d5830f6aab198 100644 --- a/tests/baselines/reference/stringIncludes.symbols +++ b/tests/baselines/reference/stringIncludes.symbols @@ -4,11 +4,11 @@ var includes: boolean; includes = "abcde".includes("cd"); >includes : Symbol(includes, Decl(stringIncludes.ts, 0, 3)) ->"abcde".includes : Symbol(String.includes, Decl(lib.es2015.core.d.ts, --, --)) ->includes : Symbol(String.includes, Decl(lib.es2015.core.d.ts, --, --)) +>"abcde".includes : Symbol(String.includes, Decl(lib.es6.d.ts, --, --)) +>includes : Symbol(String.includes, Decl(lib.es6.d.ts, --, --)) includes = "abcde".includes("cd", 2); >includes : Symbol(includes, Decl(stringIncludes.ts, 0, 3)) ->"abcde".includes : Symbol(String.includes, Decl(lib.es2015.core.d.ts, --, --)) ->includes : Symbol(String.includes, Decl(lib.es2015.core.d.ts, --, --)) +>"abcde".includes : Symbol(String.includes, Decl(lib.es6.d.ts, --, --)) +>includes : Symbol(String.includes, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.symbols b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.symbols index e97b2a5911843..b656c54d94409 100644 --- a/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.symbols +++ b/tests/baselines/reference/stringLiteralTypeIsSubtypeOfString.symbols @@ -84,7 +84,7 @@ function f7(x: 'a'); function f7(x: Date); >f7 : Symbol(f7, Decl(stringLiteralTypeIsSubtypeOfString.ts, 27, 23), Decl(stringLiteralTypeIsSubtypeOfString.ts, 29, 20), Decl(stringLiteralTypeIsSubtypeOfString.ts, 30, 21)) >x : Symbol(x, Decl(stringLiteralTypeIsSubtypeOfString.ts, 30, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function f7(x: any) { } >f7 : Symbol(f7, Decl(stringLiteralTypeIsSubtypeOfString.ts, 27, 23), Decl(stringLiteralTypeIsSubtypeOfString.ts, 29, 20), Decl(stringLiteralTypeIsSubtypeOfString.ts, 30, 21)) diff --git a/tests/baselines/reference/subtypesOfAny.symbols b/tests/baselines/reference/subtypesOfAny.symbols index 5e5353e8c9deb..8429aea06e48f 100644 --- a/tests/baselines/reference/subtypesOfAny.symbols +++ b/tests/baselines/reference/subtypesOfAny.symbols @@ -53,7 +53,7 @@ interface I5 { foo: Date; >foo : Symbol(I5.foo, Decl(subtypesOfAny.ts, 27, 21)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/subtypesOfTypeParameter.symbols b/tests/baselines/reference/subtypesOfTypeParameter.symbols index b3988b0aa41a7..c01c5ae7b8285 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.symbols +++ b/tests/baselines/reference/subtypesOfTypeParameter.symbols @@ -138,13 +138,13 @@ function f2(x: T, y: U) { var r4 = true ? new Date() : x; >r4 : Symbol(r4, Decl(subtypesOfTypeParameter.ts, 46, 7), Decl(subtypesOfTypeParameter.ts, 47, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(subtypesOfTypeParameter.ts, 29, 18)) var r4 = true ? x : new Date(); >r4 : Symbol(r4, Decl(subtypesOfTypeParameter.ts, 46, 7), Decl(subtypesOfTypeParameter.ts, 47, 7)) >x : Symbol(x, Decl(subtypesOfTypeParameter.ts, 29, 18)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r5 = true ? /1/ : x; >r5 : Symbol(r5, Decl(subtypesOfTypeParameter.ts, 49, 7), Decl(subtypesOfTypeParameter.ts, 50, 7)) diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.symbols b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.symbols index b43bafcdf6d76..3fc027f8cce12 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.symbols +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.symbols @@ -267,13 +267,13 @@ class D14 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 82, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 82, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 82, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) [x: string]: Date; >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints.ts, 83, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: T; // ok >foo : Symbol(D14.foo, Decl(subtypesOfTypeParameterWithConstraints.ts, 83, 22)) @@ -287,7 +287,7 @@ class D15 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 87, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 87, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 87, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints.ts, 87, 10)) @@ -307,7 +307,7 @@ class D16 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 92, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 92, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 92, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 92, 22)) @@ -327,7 +327,7 @@ class D17 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 97, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 97, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 97, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 97, 35)) @@ -349,13 +349,13 @@ class D18 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 104, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 104, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 104, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) [x: string]: Date; >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints.ts, 105, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: T; // ok >foo : Symbol(D18.foo, Decl(subtypesOfTypeParameterWithConstraints.ts, 105, 22)) @@ -369,7 +369,7 @@ class D19 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 109, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 109, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 109, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints.ts, 109, 10)) @@ -389,7 +389,7 @@ class D20 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 114, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 114, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 114, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 114, 22)) @@ -409,7 +409,7 @@ class D21 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 119, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 119, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 119, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 119, 35)) @@ -431,13 +431,13 @@ class D22 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 126, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 126, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 126, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) [x: string]: Date; >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints.ts, 127, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: T; // ok >foo : Symbol(D22.foo, Decl(subtypesOfTypeParameterWithConstraints.ts, 127, 22)) @@ -451,7 +451,7 @@ class D23 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 131, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 131, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 131, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints.ts, 131, 10)) @@ -471,7 +471,7 @@ class D24 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 136, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 136, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 136, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 136, 22)) @@ -491,7 +491,7 @@ class D25 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 141, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 141, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 141, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 141, 35)) @@ -513,17 +513,17 @@ class D26 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 148, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 148, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 148, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) [x: string]: Date; >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints.ts, 149, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: Date; // ok >foo : Symbol(D26.foo, Decl(subtypesOfTypeParameterWithConstraints.ts, 149, 22)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } class D27 extends C3 { @@ -533,7 +533,7 @@ class D27 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 153, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 153, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 153, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints.ts, 153, 10)) @@ -543,7 +543,7 @@ class D27 extends C3 { foo: Date; // error >foo : Symbol(D27.foo, Decl(subtypesOfTypeParameterWithConstraints.ts, 154, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } class D28 extends C3 { @@ -553,7 +553,7 @@ class D28 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 158, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 158, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 158, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 158, 22)) @@ -563,7 +563,7 @@ class D28 extends C3 { foo: Date; // error >foo : Symbol(D28.foo, Decl(subtypesOfTypeParameterWithConstraints.ts, 159, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } class D29 extends C3 { @@ -573,7 +573,7 @@ class D29 extends C3 { >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints.ts, 163, 22)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 163, 35)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 163, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >C3 : Symbol(C3, Decl(subtypesOfTypeParameterWithConstraints.ts, 0, 0)) >V : Symbol(V, Decl(subtypesOfTypeParameterWithConstraints.ts, 163, 35)) @@ -583,5 +583,5 @@ class D29 extends C3 { foo: Date; // error >foo : Symbol(D29.foo, Decl(subtypesOfTypeParameterWithConstraints.ts, 164, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.symbols b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.symbols index b33b9d212f2a4..e28bd3c05ba86 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.symbols +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.symbols @@ -76,7 +76,7 @@ function f3(x: T, y: U) { >T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 12)) >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 24)) >U : Symbol(U, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 24)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 41)) >T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 12)) >y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 46)) @@ -96,22 +96,22 @@ function f3(x: T, y: U) { var r2 = true ? x : new Date(); >r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 27, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 28, 7)) >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 41)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r2 = true ? new Date() : x; >r2 : Symbol(r2, Decl(subtypesOfTypeParameterWithConstraints2.ts, 27, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 28, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 41)) // ok var r3 = true ? y : new Date(); >r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints2.ts, 31, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 32, 7)) >y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 46)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r3 = true ? new Date() : y; >r3 : Symbol(r3, Decl(subtypesOfTypeParameterWithConstraints2.ts, 31, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 32, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >y : Symbol(y, Decl(subtypesOfTypeParameterWithConstraints2.ts, 22, 46)) } @@ -235,19 +235,19 @@ function f7(x: T) { function f8(x: T) { >f8 : Symbol(f8, Decl(subtypesOfTypeParameterWithConstraints2.ts, 71, 1)) >T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 28)) >T : Symbol(T, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 12)) var r4 = true ? new Date() : x; // ok >r4 : Symbol(r4, Decl(subtypesOfTypeParameterWithConstraints2.ts, 74, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 75, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 28)) var r4 = true ? x : new Date(); // ok >r4 : Symbol(r4, Decl(subtypesOfTypeParameterWithConstraints2.ts, 74, 7), Decl(subtypesOfTypeParameterWithConstraints2.ts, 75, 7)) >x : Symbol(x, Decl(subtypesOfTypeParameterWithConstraints2.ts, 73, 28)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } function f9(x: T) { diff --git a/tests/baselines/reference/subtypesOfUnion.symbols b/tests/baselines/reference/subtypesOfUnion.symbols index 17a9cdf96f22d..999760c7e0c4a 100644 --- a/tests/baselines/reference/subtypesOfUnion.symbols +++ b/tests/baselines/reference/subtypesOfUnion.symbols @@ -59,7 +59,7 @@ interface I1 { foo6: Date; // error >foo6 : Symbol(I1.foo6, Decl(subtypesOfUnion.ts, 16, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo7: RegExp; // error >foo7 : Symbol(I1.foo7, Decl(subtypesOfUnion.ts, 17, 15)) @@ -137,7 +137,7 @@ interface I2 { foo6: Date; // error >foo6 : Symbol(I2.foo6, Decl(subtypesOfUnion.ts, 37, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo7: RegExp; // error >foo7 : Symbol(I2.foo7, Decl(subtypesOfUnion.ts, 38, 15)) diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.symbols b/tests/baselines/reference/subtypingWithCallSignatures2.symbols index 95158bb25d913..7963a0fc4140e 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.symbols +++ b/tests/baselines/reference/subtypingWithCallSignatures2.symbols @@ -297,8 +297,8 @@ declare function foo18(a: { (a: Date): Date; >a : Symbol(a, Decl(subtypingWithCallSignatures2.ts, 74, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }): any[]; }): typeof a; diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.symbols b/tests/baselines/reference/subtypingWithConstructSignatures2.symbols index cbb72b9f39611..b66b6b0db20b6 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.symbols +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.symbols @@ -297,8 +297,8 @@ declare function foo18(a: { new (a: Date): Date; >a : Symbol(a, Decl(subtypingWithConstructSignatures2.ts, 74, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) }): any[]; }): typeof a; diff --git a/tests/baselines/reference/superSymbolIndexedAccess1.symbols b/tests/baselines/reference/superSymbolIndexedAccess1.symbols index 9141771f0c9ed..3eae80f32c9a8 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess1.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess1.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess1.ts === var symbol = Symbol.for('myThing'); >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess1.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) class Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess1.ts, 0, 35)) diff --git a/tests/baselines/reference/superSymbolIndexedAccess2.symbols b/tests/baselines/reference/superSymbolIndexedAccess2.symbols index 1e10d3a9f9491..3c8a29bef2cc8 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess2.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess2.symbols @@ -3,9 +3,9 @@ class Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess2.ts, 0, 0)) [Symbol.isConcatSpreadable]() { ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) return 0; } @@ -16,14 +16,14 @@ class Bar extends Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess2.ts, 0, 0)) [Symbol.isConcatSpreadable]() { ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) return super[Symbol.isConcatSpreadable](); >super : Symbol(Foo, Decl(superSymbolIndexedAccess2.ts, 0, 0)) ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } } diff --git a/tests/baselines/reference/superSymbolIndexedAccess3.symbols b/tests/baselines/reference/superSymbolIndexedAccess3.symbols index 6fde2737c91cc..81e9c9174ec81 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess3.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess3.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess3.ts === var symbol = Symbol.for('myThing'); >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess3.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) class Foo { >Foo : Symbol(Foo, Decl(superSymbolIndexedAccess3.ts, 0, 35)) diff --git a/tests/baselines/reference/superSymbolIndexedAccess4.symbols b/tests/baselines/reference/superSymbolIndexedAccess4.symbols index 8254361ecef77..4bf8ea796c1c5 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess4.symbols +++ b/tests/baselines/reference/superSymbolIndexedAccess4.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/expressions/superPropertyAccess/superSymbolIndexedAccess4.ts === var symbol = Symbol.for('myThing'); >symbol : Symbol(symbol, Decl(superSymbolIndexedAccess4.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) class Bar { >Bar : Symbol(Bar, Decl(superSymbolIndexedAccess4.ts, 0, 35)) diff --git a/tests/baselines/reference/switchStatements.symbols b/tests/baselines/reference/switchStatements.symbols index af30b71af6623..9d4a691d2ceb9 100644 --- a/tests/baselines/reference/switchStatements.symbols +++ b/tests/baselines/reference/switchStatements.symbols @@ -24,7 +24,7 @@ switch (x) { >undefined : Symbol(undefined) case new Date(12): ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) case new Object(): >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) @@ -90,7 +90,7 @@ switch (undefined) { } >undefined : Symbol(undefined) switch (new Date(12)) { } ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) switch (new Object()) { } >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolDeclarationEmit1.symbols b/tests/baselines/reference/symbolDeclarationEmit1.symbols index 86f57e7de92cb..55fb0b38ba48a 100644 --- a/tests/baselines/reference/symbolDeclarationEmit1.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit1.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit1.ts, 0, 0)) [Symbol.toPrimitive]: number; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit10.symbols b/tests/baselines/reference/symbolDeclarationEmit10.symbols index bcc562e478e6a..68869dbc2b323 100644 --- a/tests/baselines/reference/symbolDeclarationEmit10.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit10.symbols @@ -3,13 +3,13 @@ var obj = { >obj : Symbol(obj, Decl(symbolDeclarationEmit10.ts, 0, 3)) get [Symbol.isConcatSpreadable]() { return '' }, ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) set [Symbol.isConcatSpreadable](x) { } ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit10.ts, 2, 36)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit11.symbols b/tests/baselines/reference/symbolDeclarationEmit11.symbols index 8b270daad5e67..5157fb3bdfde2 100644 --- a/tests/baselines/reference/symbolDeclarationEmit11.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit11.symbols @@ -3,23 +3,23 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit11.ts, 0, 0)) static [Symbol.iterator] = 0; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) static [Symbol.isConcatSpreadable]() { } ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) static get [Symbol.toPrimitive]() { return ""; } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) static set [Symbol.toPrimitive](x) { } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit11.ts, 4, 36)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit12.symbols b/tests/baselines/reference/symbolDeclarationEmit12.symbols index 64d747cfbad1e..7ac8f81bf342a 100644 --- a/tests/baselines/reference/symbolDeclarationEmit12.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit12.symbols @@ -9,37 +9,37 @@ module M { >C : Symbol(C, Decl(symbolDeclarationEmit12.ts, 1, 19)) [Symbol.iterator]: I; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >I : Symbol(I, Decl(symbolDeclarationEmit12.ts, 0, 10)) [Symbol.toPrimitive](x: I) { } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit12.ts, 4, 29)) >I : Symbol(I, Decl(symbolDeclarationEmit12.ts, 0, 10)) [Symbol.isConcatSpreadable](): I { ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) >I : Symbol(I, Decl(symbolDeclarationEmit12.ts, 0, 10)) return undefined >undefined : Symbol(undefined) } get [Symbol.toPrimitive]() { return undefined; } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >undefined : Symbol(undefined) set [Symbol.toPrimitive](x: I) { } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit12.ts, 9, 33)) >I : Symbol(I, Decl(symbolDeclarationEmit12.ts, 0, 10)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit13.symbols b/tests/baselines/reference/symbolDeclarationEmit13.symbols index b0884c44cb8eb..93420981a1046 100644 --- a/tests/baselines/reference/symbolDeclarationEmit13.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit13.symbols @@ -3,13 +3,13 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit13.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) set [Symbol.toStringTag](x) { } ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit13.ts, 2, 29)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit14.symbols b/tests/baselines/reference/symbolDeclarationEmit14.symbols index e20e33483098f..2d5b394fcff42 100644 --- a/tests/baselines/reference/symbolDeclarationEmit14.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit14.symbols @@ -3,12 +3,12 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit14.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) get [Symbol.toStringTag]() { return ""; } ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit2.symbols b/tests/baselines/reference/symbolDeclarationEmit2.symbols index 348760f0d7d83..050fb90671eb8 100644 --- a/tests/baselines/reference/symbolDeclarationEmit2.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit2.symbols @@ -3,7 +3,7 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit2.ts, 0, 0)) [Symbol.toPrimitive] = ""; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit3.symbols b/tests/baselines/reference/symbolDeclarationEmit3.symbols index 5bb8d67984e47..f5f8034718183 100644 --- a/tests/baselines/reference/symbolDeclarationEmit3.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit3.symbols @@ -3,20 +3,20 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit3.ts, 0, 0)) [Symbol.toPrimitive](x: number); ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit3.ts, 1, 25)) [Symbol.toPrimitive](x: string); ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit3.ts, 2, 25)) [Symbol.toPrimitive](x: any) { } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit3.ts, 3, 25)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit4.symbols b/tests/baselines/reference/symbolDeclarationEmit4.symbols index 89a4714f941d1..677aef893b20e 100644 --- a/tests/baselines/reference/symbolDeclarationEmit4.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit4.symbols @@ -3,13 +3,13 @@ class C { >C : Symbol(C, Decl(symbolDeclarationEmit4.ts, 0, 0)) get [Symbol.toPrimitive]() { return ""; } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) set [Symbol.toPrimitive](x) { } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolDeclarationEmit4.ts, 2, 29)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit5.symbols b/tests/baselines/reference/symbolDeclarationEmit5.symbols index bd1049b4e001f..f37e669a4d11e 100644 --- a/tests/baselines/reference/symbolDeclarationEmit5.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit5.symbols @@ -3,7 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolDeclarationEmit5.ts, 0, 0)) [Symbol.isConcatSpreadable](): string; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit6.symbols b/tests/baselines/reference/symbolDeclarationEmit6.symbols index 19b86ff2b666e..b7a54e7db9251 100644 --- a/tests/baselines/reference/symbolDeclarationEmit6.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit6.symbols @@ -3,7 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolDeclarationEmit6.ts, 0, 0)) [Symbol.isConcatSpreadable]: string; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit7.symbols b/tests/baselines/reference/symbolDeclarationEmit7.symbols index 2cf42a5c5cc03..8a03aeeb28027 100644 --- a/tests/baselines/reference/symbolDeclarationEmit7.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit7.symbols @@ -3,7 +3,7 @@ var obj: { >obj : Symbol(obj, Decl(symbolDeclarationEmit7.ts, 0, 3)) [Symbol.isConcatSpreadable]: string; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit8.symbols b/tests/baselines/reference/symbolDeclarationEmit8.symbols index bb6c4728a08d9..c69f666c47024 100644 --- a/tests/baselines/reference/symbolDeclarationEmit8.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit8.symbols @@ -3,7 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolDeclarationEmit8.ts, 0, 3)) [Symbol.isConcatSpreadable]: 0 ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolDeclarationEmit9.symbols b/tests/baselines/reference/symbolDeclarationEmit9.symbols index 60fdbf63c95b8..37ba6536f9c21 100644 --- a/tests/baselines/reference/symbolDeclarationEmit9.symbols +++ b/tests/baselines/reference/symbolDeclarationEmit9.symbols @@ -3,7 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolDeclarationEmit9.ts, 0, 3)) [Symbol.isConcatSpreadable]() { } ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolProperty10.symbols b/tests/baselines/reference/symbolProperty10.symbols index 7f87374222108..5982804155482 100644 --- a/tests/baselines/reference/symbolProperty10.symbols +++ b/tests/baselines/reference/symbolProperty10.symbols @@ -3,9 +3,9 @@ class C { >C : Symbol(C, Decl(symbolProperty10.ts, 0, 0)) [Symbol.iterator]: { x; y }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty10.ts, 1, 24)) >y : Symbol(y, Decl(symbolProperty10.ts, 1, 27)) } @@ -13,9 +13,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty10.ts, 2, 1)) [Symbol.iterator]?: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty10.ts, 4, 25)) } diff --git a/tests/baselines/reference/symbolProperty11.symbols b/tests/baselines/reference/symbolProperty11.symbols index bd1b433ed7073..042e1f0eced49 100644 --- a/tests/baselines/reference/symbolProperty11.symbols +++ b/tests/baselines/reference/symbolProperty11.symbols @@ -6,9 +6,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty11.ts, 0, 11)) [Symbol.iterator]?: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty11.ts, 2, 25)) } diff --git a/tests/baselines/reference/symbolProperty12.symbols b/tests/baselines/reference/symbolProperty12.symbols index a35f66f3cd10d..47d3ecac2e7f3 100644 --- a/tests/baselines/reference/symbolProperty12.symbols +++ b/tests/baselines/reference/symbolProperty12.symbols @@ -3,18 +3,18 @@ class C { >C : Symbol(C, Decl(symbolProperty12.ts, 0, 0)) private [Symbol.iterator]: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty12.ts, 1, 32)) } interface I { >I : Symbol(I, Decl(symbolProperty12.ts, 2, 1)) [Symbol.iterator]: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty12.ts, 4, 24)) } diff --git a/tests/baselines/reference/symbolProperty13.symbols b/tests/baselines/reference/symbolProperty13.symbols index e85e75f43d9d7..9cb29dcfa1474 100644 --- a/tests/baselines/reference/symbolProperty13.symbols +++ b/tests/baselines/reference/symbolProperty13.symbols @@ -3,9 +3,9 @@ class C { >C : Symbol(C, Decl(symbolProperty13.ts, 0, 0)) [Symbol.iterator]: { x; y }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty13.ts, 1, 24)) >y : Symbol(y, Decl(symbolProperty13.ts, 1, 27)) } @@ -13,9 +13,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty13.ts, 2, 1)) [Symbol.iterator]: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty13.ts, 4, 24)) } diff --git a/tests/baselines/reference/symbolProperty14.symbols b/tests/baselines/reference/symbolProperty14.symbols index b13fbbc1f41cc..0de3cd69011e4 100644 --- a/tests/baselines/reference/symbolProperty14.symbols +++ b/tests/baselines/reference/symbolProperty14.symbols @@ -3,9 +3,9 @@ class C { >C : Symbol(C, Decl(symbolProperty14.ts, 0, 0)) [Symbol.iterator]: { x; y }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty14.ts, 1, 24)) >y : Symbol(y, Decl(symbolProperty14.ts, 1, 27)) } @@ -13,9 +13,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty14.ts, 2, 1)) [Symbol.iterator]?: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty14.ts, 4, 25)) } diff --git a/tests/baselines/reference/symbolProperty15.symbols b/tests/baselines/reference/symbolProperty15.symbols index c9bea5e5db22c..2f0641fcbd368 100644 --- a/tests/baselines/reference/symbolProperty15.symbols +++ b/tests/baselines/reference/symbolProperty15.symbols @@ -6,9 +6,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty15.ts, 0, 11)) [Symbol.iterator]?: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty15.ts, 2, 25)) } diff --git a/tests/baselines/reference/symbolProperty16.symbols b/tests/baselines/reference/symbolProperty16.symbols index 8e13d7babdf31..8d31ef4219c34 100644 --- a/tests/baselines/reference/symbolProperty16.symbols +++ b/tests/baselines/reference/symbolProperty16.symbols @@ -3,18 +3,18 @@ class C { >C : Symbol(C, Decl(symbolProperty16.ts, 0, 0)) private [Symbol.iterator]: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty16.ts, 1, 32)) } interface I { >I : Symbol(I, Decl(symbolProperty16.ts, 2, 1)) [Symbol.iterator]: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty16.ts, 4, 24)) } diff --git a/tests/baselines/reference/symbolProperty17.symbols b/tests/baselines/reference/symbolProperty17.symbols index 688a391043bb9..baa5b5d5f0811 100644 --- a/tests/baselines/reference/symbolProperty17.symbols +++ b/tests/baselines/reference/symbolProperty17.symbols @@ -3,9 +3,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty17.ts, 0, 0)) [Symbol.iterator]: number; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) [s: symbol]: string; >s : Symbol(s, Decl(symbolProperty17.ts, 2, 5)) @@ -20,7 +20,7 @@ var i: I; var it = i[Symbol.iterator]; >it : Symbol(it, Decl(symbolProperty17.ts, 7, 3)) >i : Symbol(i, Decl(symbolProperty17.ts, 6, 3)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty18.symbols b/tests/baselines/reference/symbolProperty18.symbols index 54769192d9014..590f55262badb 100644 --- a/tests/baselines/reference/symbolProperty18.symbols +++ b/tests/baselines/reference/symbolProperty18.symbols @@ -3,39 +3,39 @@ var i = { >i : Symbol(i, Decl(symbolProperty18.ts, 0, 3)) [Symbol.iterator]: 0, ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) [Symbol.toStringTag]() { return "" }, ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) set [Symbol.toPrimitive](p: boolean) { } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(symbolProperty18.ts, 3, 29)) } var it = i[Symbol.iterator]; >it : Symbol(it, Decl(symbolProperty18.ts, 6, 3)) >i : Symbol(i, Decl(symbolProperty18.ts, 0, 3)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) var str = i[Symbol.toStringTag](); >str : Symbol(str, Decl(symbolProperty18.ts, 7, 3)) >i : Symbol(i, Decl(symbolProperty18.ts, 0, 3)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) i[Symbol.toPrimitive] = false; >i : Symbol(i, Decl(symbolProperty18.ts, 0, 3)) ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty19.symbols b/tests/baselines/reference/symbolProperty19.symbols index 5e8800e07cfab..e903d75121ce2 100644 --- a/tests/baselines/reference/symbolProperty19.symbols +++ b/tests/baselines/reference/symbolProperty19.symbols @@ -3,15 +3,15 @@ var i = { >i : Symbol(i, Decl(symbolProperty19.ts, 0, 3)) [Symbol.iterator]: { p: null }, ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(symbolProperty19.ts, 1, 24)) [Symbol.toStringTag]() { return { p: undefined }; } ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) >p : Symbol(p, Decl(symbolProperty19.ts, 2, 37)) >undefined : Symbol(undefined) } @@ -19,14 +19,14 @@ var i = { var it = i[Symbol.iterator]; >it : Symbol(it, Decl(symbolProperty19.ts, 5, 3)) >i : Symbol(i, Decl(symbolProperty19.ts, 0, 3)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) var str = i[Symbol.toStringTag](); >str : Symbol(str, Decl(symbolProperty19.ts, 6, 3)) >i : Symbol(i, Decl(symbolProperty19.ts, 0, 3)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty2.symbols b/tests/baselines/reference/symbolProperty2.symbols index 90cb47c001102..5715e4a748558 100644 --- a/tests/baselines/reference/symbolProperty2.symbols +++ b/tests/baselines/reference/symbolProperty2.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/Symbols/symbolProperty2.ts === var s = Symbol(); >s : Symbol(s, Decl(symbolProperty2.ts, 0, 3)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) var x = { >x : Symbol(x, Decl(symbolProperty2.ts, 1, 3)) diff --git a/tests/baselines/reference/symbolProperty20.symbols b/tests/baselines/reference/symbolProperty20.symbols index 60fc435898e2f..e2b227bea7127 100644 --- a/tests/baselines/reference/symbolProperty20.symbols +++ b/tests/baselines/reference/symbolProperty20.symbols @@ -3,15 +3,15 @@ interface I { >I : Symbol(I, Decl(symbolProperty20.ts, 0, 0)) [Symbol.iterator]: (s: string) => string; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(symbolProperty20.ts, 1, 24)) [Symbol.toStringTag](s: number): number; ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(symbolProperty20.ts, 2, 25)) } @@ -20,16 +20,16 @@ var i: I = { >I : Symbol(I, Decl(symbolProperty20.ts, 0, 0)) [Symbol.iterator]: s => s, ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(symbolProperty20.ts, 6, 22)) >s : Symbol(s, Decl(symbolProperty20.ts, 6, 22)) [Symbol.toStringTag](n) { return n; } ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(symbolProperty20.ts, 7, 25)) >n : Symbol(n, Decl(symbolProperty20.ts, 7, 25)) } diff --git a/tests/baselines/reference/symbolProperty21.symbols b/tests/baselines/reference/symbolProperty21.symbols index 20310be60f33f..d2deabcf61192 100644 --- a/tests/baselines/reference/symbolProperty21.symbols +++ b/tests/baselines/reference/symbolProperty21.symbols @@ -5,15 +5,15 @@ interface I { >U : Symbol(U, Decl(symbolProperty21.ts, 0, 14)) [Symbol.unscopables]: T; ->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.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(symbolProperty21.ts, 0, 12)) [Symbol.isConcatSpreadable]: U; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) >U : Symbol(U, Decl(symbolProperty21.ts, 0, 14)) } @@ -34,18 +34,18 @@ foo({ >foo : Symbol(foo, Decl(symbolProperty21.ts, 3, 1)) [Symbol.isConcatSpreadable]: "", ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) [Symbol.toPrimitive]: 0, ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) [Symbol.unscopables]: true ->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.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) }); diff --git a/tests/baselines/reference/symbolProperty22.symbols b/tests/baselines/reference/symbolProperty22.symbols index e4e68d81970b0..331c9a33fa430 100644 --- a/tests/baselines/reference/symbolProperty22.symbols +++ b/tests/baselines/reference/symbolProperty22.symbols @@ -5,9 +5,9 @@ interface I { >U : Symbol(U, Decl(symbolProperty22.ts, 0, 14)) [Symbol.unscopables](x: T): U; ->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.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty22.ts, 1, 25)) >T : Symbol(T, Decl(symbolProperty22.ts, 0, 12)) >U : Symbol(U, Decl(symbolProperty22.ts, 0, 14)) @@ -27,11 +27,11 @@ 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(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.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(symbolProperty22.ts, 6, 31)) ->s.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>s.length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(symbolProperty22.ts, 6, 31)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>length : Symbol(String.length, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty23.symbols b/tests/baselines/reference/symbolProperty23.symbols index 714b76fa85bcd..edfc83ac58e9d 100644 --- a/tests/baselines/reference/symbolProperty23.symbols +++ b/tests/baselines/reference/symbolProperty23.symbols @@ -3,9 +3,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty23.ts, 0, 0)) [Symbol.toPrimitive]: () => boolean; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } class C implements I { @@ -13,9 +13,9 @@ class C implements I { >I : Symbol(I, Decl(symbolProperty23.ts, 0, 0)) [Symbol.toPrimitive]() { ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) return true; } diff --git a/tests/baselines/reference/symbolProperty24.symbols b/tests/baselines/reference/symbolProperty24.symbols index 197263e16b52b..e5072faabbbec 100644 --- a/tests/baselines/reference/symbolProperty24.symbols +++ b/tests/baselines/reference/symbolProperty24.symbols @@ -3,9 +3,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty24.ts, 0, 0)) [Symbol.toPrimitive]: () => boolean; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } class C implements I { @@ -13,9 +13,9 @@ class C implements I { >I : Symbol(I, Decl(symbolProperty24.ts, 0, 0)) [Symbol.toPrimitive]() { ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) return ""; } diff --git a/tests/baselines/reference/symbolProperty25.symbols b/tests/baselines/reference/symbolProperty25.symbols index 06a5c01653c4c..ea7eb9ab719c7 100644 --- a/tests/baselines/reference/symbolProperty25.symbols +++ b/tests/baselines/reference/symbolProperty25.symbols @@ -3,9 +3,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty25.ts, 0, 0)) [Symbol.toPrimitive]: () => boolean; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } class C implements I { @@ -13,9 +13,9 @@ class C implements I { >I : Symbol(I, Decl(symbolProperty25.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return ""; } diff --git a/tests/baselines/reference/symbolProperty26.symbols b/tests/baselines/reference/symbolProperty26.symbols index 785a2e395cb6f..1a2983a78af0f 100644 --- a/tests/baselines/reference/symbolProperty26.symbols +++ b/tests/baselines/reference/symbolProperty26.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty26.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return ""; } @@ -16,9 +16,9 @@ class C2 extends C1 { >C1 : Symbol(C1, Decl(symbolProperty26.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return ""; } diff --git a/tests/baselines/reference/symbolProperty27.symbols b/tests/baselines/reference/symbolProperty27.symbols index 1b050b617c242..974b9484e74ec 100644 --- a/tests/baselines/reference/symbolProperty27.symbols +++ b/tests/baselines/reference/symbolProperty27.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty27.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return {}; } @@ -16,9 +16,9 @@ class C2 extends C1 { >C1 : Symbol(C1, Decl(symbolProperty27.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return ""; } diff --git a/tests/baselines/reference/symbolProperty28.symbols b/tests/baselines/reference/symbolProperty28.symbols index c72de5fefb5c3..0d5cbab048c91 100644 --- a/tests/baselines/reference/symbolProperty28.symbols +++ b/tests/baselines/reference/symbolProperty28.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty28.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return { x: "" }; >x : Symbol(x, Decl(symbolProperty28.ts, 2, 16)) @@ -24,8 +24,8 @@ var obj = c[Symbol.toStringTag]().x; >obj : Symbol(obj, Decl(symbolProperty28.ts, 9, 3)) >c[Symbol.toStringTag]().x : Symbol(x, Decl(symbolProperty28.ts, 2, 16)) >c : Symbol(c, Decl(symbolProperty28.ts, 8, 3)) ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty28.ts, 2, 16)) diff --git a/tests/baselines/reference/symbolProperty29.symbols b/tests/baselines/reference/symbolProperty29.symbols index 26ecd9a0f70cb..e18805b863623 100644 --- a/tests/baselines/reference/symbolProperty29.symbols +++ b/tests/baselines/reference/symbolProperty29.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty29.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return { x: "" }; >x : Symbol(x, Decl(symbolProperty29.ts, 2, 16)) diff --git a/tests/baselines/reference/symbolProperty3.symbols b/tests/baselines/reference/symbolProperty3.symbols index ef35240eba15f..8ae4cda24eb60 100644 --- a/tests/baselines/reference/symbolProperty3.symbols +++ b/tests/baselines/reference/symbolProperty3.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/Symbols/symbolProperty3.ts === var s = Symbol; >s : Symbol(s, Decl(symbolProperty3.ts, 0, 3)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) var x = { >x : Symbol(x, Decl(symbolProperty3.ts, 1, 3)) diff --git a/tests/baselines/reference/symbolProperty30.symbols b/tests/baselines/reference/symbolProperty30.symbols index c4e758c58d8d4..7cc4076e1c504 100644 --- a/tests/baselines/reference/symbolProperty30.symbols +++ b/tests/baselines/reference/symbolProperty30.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty30.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return { x: "" }; >x : Symbol(x, Decl(symbolProperty30.ts, 2, 16)) diff --git a/tests/baselines/reference/symbolProperty31.symbols b/tests/baselines/reference/symbolProperty31.symbols index 65fe5a0dd9439..b75a38690b3d9 100644 --- a/tests/baselines/reference/symbolProperty31.symbols +++ b/tests/baselines/reference/symbolProperty31.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty31.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return { x: "" }; >x : Symbol(x, Decl(symbolProperty31.ts, 2, 16)) diff --git a/tests/baselines/reference/symbolProperty32.symbols b/tests/baselines/reference/symbolProperty32.symbols index 6f069ac9b4e1f..c7c24c5de678c 100644 --- a/tests/baselines/reference/symbolProperty32.symbols +++ b/tests/baselines/reference/symbolProperty32.symbols @@ -3,9 +3,9 @@ class C1 { >C1 : Symbol(C1, Decl(symbolProperty32.ts, 0, 0)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return { x: "" }; >x : Symbol(x, Decl(symbolProperty32.ts, 2, 16)) diff --git a/tests/baselines/reference/symbolProperty33.symbols b/tests/baselines/reference/symbolProperty33.symbols index 1bcf313626e99..455eadbbd0e3c 100644 --- a/tests/baselines/reference/symbolProperty33.symbols +++ b/tests/baselines/reference/symbolProperty33.symbols @@ -4,9 +4,9 @@ class C1 extends C2 { >C2 : Symbol(C2, Decl(symbolProperty33.ts, 4, 1)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return { x: "" }; >x : Symbol(x, Decl(symbolProperty33.ts, 2, 16)) diff --git a/tests/baselines/reference/symbolProperty34.symbols b/tests/baselines/reference/symbolProperty34.symbols index ab13908da9db6..ff2a563ef3a37 100644 --- a/tests/baselines/reference/symbolProperty34.symbols +++ b/tests/baselines/reference/symbolProperty34.symbols @@ -4,9 +4,9 @@ class C1 extends C2 { >C2 : Symbol(C2, Decl(symbolProperty34.ts, 4, 1)) [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return { x: "" }; >x : Symbol(x, Decl(symbolProperty34.ts, 2, 16)) diff --git a/tests/baselines/reference/symbolProperty35.symbols b/tests/baselines/reference/symbolProperty35.symbols index 9de473d598315..2558beac49d1b 100644 --- a/tests/baselines/reference/symbolProperty35.symbols +++ b/tests/baselines/reference/symbolProperty35.symbols @@ -3,18 +3,18 @@ interface I1 { >I1 : Symbol(I1, Decl(symbolProperty35.ts, 0, 0)) [Symbol.toStringTag](): { x: string } ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty35.ts, 1, 29)) } interface I2 { >I2 : Symbol(I2, Decl(symbolProperty35.ts, 2, 1)) [Symbol.toStringTag](): { x: number } ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty35.ts, 4, 29)) } diff --git a/tests/baselines/reference/symbolProperty36.symbols b/tests/baselines/reference/symbolProperty36.symbols index 9636c1c30f8f6..f91244bf7e548 100644 --- a/tests/baselines/reference/symbolProperty36.symbols +++ b/tests/baselines/reference/symbolProperty36.symbols @@ -3,12 +3,12 @@ var x = { >x : Symbol(x, Decl(symbolProperty36.ts, 0, 3)) [Symbol.isConcatSpreadable]: 0, ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) [Symbol.isConcatSpreadable]: 1 ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolProperty37.symbols b/tests/baselines/reference/symbolProperty37.symbols index 392bbf52c8cf1..1f6f7f187d710 100644 --- a/tests/baselines/reference/symbolProperty37.symbols +++ b/tests/baselines/reference/symbolProperty37.symbols @@ -3,12 +3,12 @@ interface I { >I : Symbol(I, Decl(symbolProperty37.ts, 0, 0)) [Symbol.isConcatSpreadable]: string; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) [Symbol.isConcatSpreadable]: string; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolProperty38.symbols b/tests/baselines/reference/symbolProperty38.symbols index 9bd7b40d9d0fe..b5eea169b5608 100644 --- a/tests/baselines/reference/symbolProperty38.symbols +++ b/tests/baselines/reference/symbolProperty38.symbols @@ -3,15 +3,15 @@ interface I { >I : Symbol(I, Decl(symbolProperty38.ts, 0, 0), Decl(symbolProperty38.ts, 2, 1)) [Symbol.isConcatSpreadable]: string; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } interface I { >I : Symbol(I, Decl(symbolProperty38.ts, 0, 0), Decl(symbolProperty38.ts, 2, 1)) [Symbol.isConcatSpreadable]: string; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolProperty39.symbols b/tests/baselines/reference/symbolProperty39.symbols index 967bb9fd1d046..0e7ad86dd133e 100644 --- a/tests/baselines/reference/symbolProperty39.symbols +++ b/tests/baselines/reference/symbolProperty39.symbols @@ -3,30 +3,30 @@ class C { >C : Symbol(C, Decl(symbolProperty39.ts, 0, 0)) [Symbol.iterator](x: string): string; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty39.ts, 1, 22)) [Symbol.iterator](x: number): number; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty39.ts, 2, 22)) [Symbol.iterator](x: any) { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty39.ts, 3, 22)) return undefined; >undefined : Symbol(undefined) } [Symbol.iterator](x: any) { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty39.ts, 6, 22)) return undefined; diff --git a/tests/baselines/reference/symbolProperty4.symbols b/tests/baselines/reference/symbolProperty4.symbols index c1f7c82de7d75..f525c68cc322a 100644 --- a/tests/baselines/reference/symbolProperty4.symbols +++ b/tests/baselines/reference/symbolProperty4.symbols @@ -3,13 +3,13 @@ var x = { >x : Symbol(x, Decl(symbolProperty4.ts, 0, 3)) [Symbol()]: 0, ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) [Symbol()]() { }, ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) get [Symbol()]() { ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) return 0; } diff --git a/tests/baselines/reference/symbolProperty40.symbols b/tests/baselines/reference/symbolProperty40.symbols index 9d546e7d42647..71fa70280b780 100644 --- a/tests/baselines/reference/symbolProperty40.symbols +++ b/tests/baselines/reference/symbolProperty40.symbols @@ -3,21 +3,21 @@ class C { >C : Symbol(C, Decl(symbolProperty40.ts, 0, 0)) [Symbol.iterator](x: string): string; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty40.ts, 1, 22)) [Symbol.iterator](x: number): number; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty40.ts, 2, 22)) [Symbol.iterator](x: any) { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty40.ts, 3, 22)) return undefined; @@ -31,13 +31,13 @@ var c = new C; c[Symbol.iterator](""); >c : Symbol(c, Decl(symbolProperty40.ts, 8, 3)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) c[Symbol.iterator](0); >c : Symbol(c, Decl(symbolProperty40.ts, 8, 3)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty41.symbols b/tests/baselines/reference/symbolProperty41.symbols index f0ef069225398..51eb63834ebf0 100644 --- a/tests/baselines/reference/symbolProperty41.symbols +++ b/tests/baselines/reference/symbolProperty41.symbols @@ -3,24 +3,24 @@ class C { >C : Symbol(C, Decl(symbolProperty41.ts, 0, 0)) [Symbol.iterator](x: string): { x: string }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty41.ts, 1, 22)) >x : Symbol(x, Decl(symbolProperty41.ts, 1, 35)) [Symbol.iterator](x: "hello"): { x: string; hello: string }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty41.ts, 2, 22)) >x : Symbol(x, Decl(symbolProperty41.ts, 2, 36)) >hello : Symbol(hello, Decl(symbolProperty41.ts, 2, 47)) [Symbol.iterator](x: any) { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty41.ts, 3, 22)) return undefined; @@ -34,13 +34,13 @@ var c = new C; c[Symbol.iterator](""); >c : Symbol(c, Decl(symbolProperty41.ts, 8, 3)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) c[Symbol.iterator]("hello"); >c : Symbol(c, Decl(symbolProperty41.ts, 8, 3)) ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty42.symbols b/tests/baselines/reference/symbolProperty42.symbols index eb6c8994f64db..62ed7cc77d3b4 100644 --- a/tests/baselines/reference/symbolProperty42.symbols +++ b/tests/baselines/reference/symbolProperty42.symbols @@ -3,21 +3,21 @@ class C { >C : Symbol(C, Decl(symbolProperty42.ts, 0, 0)) [Symbol.iterator](x: string): string; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty42.ts, 1, 22)) static [Symbol.iterator](x: number): number; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty42.ts, 2, 29)) [Symbol.iterator](x: any) { ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty42.ts, 3, 22)) return undefined; diff --git a/tests/baselines/reference/symbolProperty43.symbols b/tests/baselines/reference/symbolProperty43.symbols index 8ef4496adfb36..a7be6ab2068f8 100644 --- a/tests/baselines/reference/symbolProperty43.symbols +++ b/tests/baselines/reference/symbolProperty43.symbols @@ -3,14 +3,14 @@ class C { >C : Symbol(C, Decl(symbolProperty43.ts, 0, 0)) [Symbol.iterator](x: string): string; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty43.ts, 1, 22)) [Symbol.iterator](x: number): number; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty43.ts, 2, 22)) } diff --git a/tests/baselines/reference/symbolProperty44.symbols b/tests/baselines/reference/symbolProperty44.symbols index 95e6ca38dfbfc..d95d7cd7cc4c4 100644 --- a/tests/baselines/reference/symbolProperty44.symbols +++ b/tests/baselines/reference/symbolProperty44.symbols @@ -3,16 +3,16 @@ class C { >C : Symbol(C, Decl(symbolProperty44.ts, 0, 0)) get [Symbol.hasInstance]() { ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) return ""; } get [Symbol.hasInstance]() { ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) return ""; } diff --git a/tests/baselines/reference/symbolProperty45.symbols b/tests/baselines/reference/symbolProperty45.symbols index 0f42e37c5cf1b..e0ace066c31c0 100644 --- a/tests/baselines/reference/symbolProperty45.symbols +++ b/tests/baselines/reference/symbolProperty45.symbols @@ -3,16 +3,16 @@ class C { >C : Symbol(C, Decl(symbolProperty45.ts, 0, 0)) get [Symbol.hasInstance]() { ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) return ""; } get [Symbol.toPrimitive]() { ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) return ""; } diff --git a/tests/baselines/reference/symbolProperty46.symbols b/tests/baselines/reference/symbolProperty46.symbols index 6441ee99b70c1..14abb3c1723d9 100644 --- a/tests/baselines/reference/symbolProperty46.symbols +++ b/tests/baselines/reference/symbolProperty46.symbols @@ -3,30 +3,30 @@ class C { >C : Symbol(C, Decl(symbolProperty46.ts, 0, 0)) get [Symbol.hasInstance]() { ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) return ""; } // Should take a string set [Symbol.hasInstance](x) { ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty46.ts, 5, 29)) } } (new C)[Symbol.hasInstance] = 0; >C : Symbol(C, Decl(symbolProperty46.ts, 0, 0)) ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) (new C)[Symbol.hasInstance] = ""; >C : Symbol(C, Decl(symbolProperty46.ts, 0, 0)) ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty47.symbols b/tests/baselines/reference/symbolProperty47.symbols index fac8d794bbbcf..01f50386868b4 100644 --- a/tests/baselines/reference/symbolProperty47.symbols +++ b/tests/baselines/reference/symbolProperty47.symbols @@ -3,30 +3,30 @@ class C { >C : Symbol(C, Decl(symbolProperty47.ts, 0, 0)) get [Symbol.hasInstance]() { ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) return ""; } // Should take a string set [Symbol.hasInstance](x: number) { ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty47.ts, 5, 29)) } } (new C)[Symbol.hasInstance] = 0; >C : Symbol(C, Decl(symbolProperty47.ts, 0, 0)) ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) (new C)[Symbol.hasInstance] = ""; >C : Symbol(C, Decl(symbolProperty47.ts, 0, 0)) ->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, --, --)) +>Symbol.hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>hasInstance : Symbol(SymbolConstructor.hasInstance, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty5.symbols b/tests/baselines/reference/symbolProperty5.symbols index 1ca9150c3478a..56fa530d11244 100644 --- a/tests/baselines/reference/symbolProperty5.symbols +++ b/tests/baselines/reference/symbolProperty5.symbols @@ -3,19 +3,19 @@ var x = { >x : Symbol(x, Decl(symbolProperty5.ts, 0, 3)) [Symbol.iterator]: 0, ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) [Symbol.toPrimitive]() { }, ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) get [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return 0; } diff --git a/tests/baselines/reference/symbolProperty50.symbols b/tests/baselines/reference/symbolProperty50.symbols index 6df756a0277a9..7bdc0d6e36dc8 100644 --- a/tests/baselines/reference/symbolProperty50.symbols +++ b/tests/baselines/reference/symbolProperty50.symbols @@ -9,8 +9,8 @@ module M { >C : Symbol(C, Decl(symbolProperty50.ts, 1, 24)) [Symbol.iterator]() { } ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) } } diff --git a/tests/baselines/reference/symbolProperty51.symbols b/tests/baselines/reference/symbolProperty51.symbols index 71384602b2396..31d4edbb9308c 100644 --- a/tests/baselines/reference/symbolProperty51.symbols +++ b/tests/baselines/reference/symbolProperty51.symbols @@ -9,8 +9,8 @@ module M { >C : Symbol(C, Decl(symbolProperty51.ts, 1, 21)) [Symbol.iterator]() { } ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) } } diff --git a/tests/baselines/reference/symbolProperty52.symbols b/tests/baselines/reference/symbolProperty52.symbols index 2366a96e221cd..43cb03098201d 100644 --- a/tests/baselines/reference/symbolProperty52.symbols +++ b/tests/baselines/reference/symbolProperty52.symbols @@ -3,7 +3,7 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty52.ts, 0, 3)) [Symbol.nonsense]: 0 ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) }; @@ -12,5 +12,5 @@ obj = {}; obj[Symbol.nonsense]; >obj : Symbol(obj, Decl(symbolProperty52.ts, 0, 3)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty53.symbols b/tests/baselines/reference/symbolProperty53.symbols index 1509366356099..1a03b445673b2 100644 --- a/tests/baselines/reference/symbolProperty53.symbols +++ b/tests/baselines/reference/symbolProperty53.symbols @@ -3,15 +3,15 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty53.ts, 0, 3)) [Symbol.for]: 0 ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) }; obj[Symbol.for]; >obj : Symbol(obj, Decl(symbolProperty53.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty54.symbols b/tests/baselines/reference/symbolProperty54.symbols index f04a679179dc8..897bcd569c151 100644 --- a/tests/baselines/reference/symbolProperty54.symbols +++ b/tests/baselines/reference/symbolProperty54.symbols @@ -3,8 +3,8 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty54.ts, 0, 3)) [Symbol.prototype]: 0 ->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, --, --)) +>Symbol.prototype : Symbol(SymbolConstructor.prototype, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>prototype : Symbol(SymbolConstructor.prototype, Decl(lib.es6.d.ts, --, --)) }; diff --git a/tests/baselines/reference/symbolProperty55.symbols b/tests/baselines/reference/symbolProperty55.symbols index e87120986ee74..4b66fb9ecda2b 100644 --- a/tests/baselines/reference/symbolProperty55.symbols +++ b/tests/baselines/reference/symbolProperty55.symbols @@ -3,9 +3,9 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty55.ts, 0, 3)) [Symbol.iterator]: 0 ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) }; @@ -14,13 +14,13 @@ module M { var Symbol: SymbolConstructor; >Symbol : Symbol(Symbol, Decl(symbolProperty55.ts, 5, 7)) ->SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) +>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) // The following should be of type 'any'. This is because even though obj has a property keyed by Symbol.iterator, // the key passed in here is the *wrong* Symbol.iterator. It is not the iterator property of the global Symbol. obj[Symbol.iterator]; >obj : Symbol(obj, Decl(symbolProperty55.ts, 0, 3)) ->Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(symbolProperty55.ts, 5, 7)) ->iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolProperty56.symbols b/tests/baselines/reference/symbolProperty56.symbols index 492f28bd42cfa..e27457ece2662 100644 --- a/tests/baselines/reference/symbolProperty56.symbols +++ b/tests/baselines/reference/symbolProperty56.symbols @@ -3,9 +3,9 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty56.ts, 0, 3)) [Symbol.iterator]: 0 ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) }; diff --git a/tests/baselines/reference/symbolProperty57.symbols b/tests/baselines/reference/symbolProperty57.symbols index 05fa27816c9f0..c4ea9ec76c25a 100644 --- a/tests/baselines/reference/symbolProperty57.symbols +++ b/tests/baselines/reference/symbolProperty57.symbols @@ -3,14 +3,14 @@ var obj = { >obj : Symbol(obj, Decl(symbolProperty57.ts, 0, 3)) [Symbol.iterator]: 0 ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) }; // Should give type 'any'. obj[Symbol["nonsense"]]; >obj : Symbol(obj, Decl(symbolProperty57.ts, 0, 3)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolProperty58.symbols b/tests/baselines/reference/symbolProperty58.symbols index e4ed73991763f..ee93c88a09d3d 100644 --- a/tests/baselines/reference/symbolProperty58.symbols +++ b/tests/baselines/reference/symbolProperty58.symbols @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/Symbols/symbolProperty58.ts === interface SymbolConstructor { ->SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(symbolProperty58.ts, 0, 0)) +>SymbolConstructor : Symbol(SymbolConstructor, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(symbolProperty58.ts, 0, 0)) foo: string; >foo : Symbol(SymbolConstructor.foo, Decl(symbolProperty58.ts, 0, 29)) @@ -11,6 +11,6 @@ var obj = { [Symbol.foo]: 0 >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, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >foo : Symbol(SymbolConstructor.foo, Decl(symbolProperty58.ts, 0, 29)) } diff --git a/tests/baselines/reference/symbolProperty59.symbols b/tests/baselines/reference/symbolProperty59.symbols index 1afa5596c2f00..1268969ce36e9 100644 --- a/tests/baselines/reference/symbolProperty59.symbols +++ b/tests/baselines/reference/symbolProperty59.symbols @@ -3,7 +3,7 @@ interface I { >I : Symbol(I, Decl(symbolProperty59.ts, 0, 0)) [Symbol.keyFor]: string; ->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, --, --)) +>Symbol.keyFor : Symbol(SymbolConstructor.keyFor, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>keyFor : Symbol(SymbolConstructor.keyFor, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolProperty6.symbols b/tests/baselines/reference/symbolProperty6.symbols index 4bf20b1de551a..8943edff7d71b 100644 --- a/tests/baselines/reference/symbolProperty6.symbols +++ b/tests/baselines/reference/symbolProperty6.symbols @@ -3,24 +3,24 @@ class C { >C : Symbol(C, Decl(symbolProperty6.ts, 0, 0)) [Symbol.iterator] = 0; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) [Symbol.unscopables]: number; ->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.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) [Symbol.toPrimitive]() { } ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) get [Symbol.toStringTag]() { ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) return 0; } diff --git a/tests/baselines/reference/symbolProperty7.symbols b/tests/baselines/reference/symbolProperty7.symbols index c5db5645480a0..a19f6d16f3a30 100644 --- a/tests/baselines/reference/symbolProperty7.symbols +++ b/tests/baselines/reference/symbolProperty7.symbols @@ -3,16 +3,16 @@ class C { >C : Symbol(C, Decl(symbolProperty7.ts, 0, 0)) [Symbol()] = 0; ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) [Symbol()]: number; ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) [Symbol()]() { } ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) get [Symbol()]() { ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) return 0; } diff --git a/tests/baselines/reference/symbolProperty8.symbols b/tests/baselines/reference/symbolProperty8.symbols index e46c35b47bee3..9a94d3f128581 100644 --- a/tests/baselines/reference/symbolProperty8.symbols +++ b/tests/baselines/reference/symbolProperty8.symbols @@ -3,12 +3,12 @@ interface I { >I : Symbol(I, Decl(symbolProperty8.ts, 0, 0)) [Symbol.unscopables]: number; ->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.unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>unscopables : Symbol(SymbolConstructor.unscopables, Decl(lib.es6.d.ts, --, --)) [Symbol.toPrimitive](); ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) } diff --git a/tests/baselines/reference/symbolProperty9.symbols b/tests/baselines/reference/symbolProperty9.symbols index 8239fbb26ef7d..60aa96636952b 100644 --- a/tests/baselines/reference/symbolProperty9.symbols +++ b/tests/baselines/reference/symbolProperty9.symbols @@ -3,9 +3,9 @@ class C { >C : Symbol(C, Decl(symbolProperty9.ts, 0, 0)) [Symbol.iterator]: { x; y }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty9.ts, 1, 24)) >y : Symbol(y, Decl(symbolProperty9.ts, 1, 27)) } @@ -13,9 +13,9 @@ interface I { >I : Symbol(I, Decl(symbolProperty9.ts, 2, 1)) [Symbol.iterator]: { x }; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(symbolProperty9.ts, 4, 24)) } diff --git a/tests/baselines/reference/symbolType1.symbols b/tests/baselines/reference/symbolType1.symbols index ded0dcff47ba6..1ba6bf448fd3c 100644 --- a/tests/baselines/reference/symbolType1.symbols +++ b/tests/baselines/reference/symbolType1.symbols @@ -1,17 +1,17 @@ === tests/cases/conformance/es6/Symbols/symbolType1.ts === Symbol() instanceof Symbol; ->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, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) Symbol instanceof Symbol(); ->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, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) (Symbol() || {}) instanceof Object; // This one should be okay, it's a valid way of distinguishing types ->Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) ->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) Symbol instanceof (Symbol() || {}); ->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, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolType10.symbols b/tests/baselines/reference/symbolType10.symbols index b242cbf366b70..5d72856e22758 100644 --- a/tests/baselines/reference/symbolType10.symbols +++ b/tests/baselines/reference/symbolType10.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType10.ts === var s = Symbol.for("bitwise"); >s : Symbol(s, Decl(symbolType10.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) s & s; >s : Symbol(s, Decl(symbolType10.ts, 0, 3)) diff --git a/tests/baselines/reference/symbolType11.symbols b/tests/baselines/reference/symbolType11.symbols index 3c5fc1b61cc8e..4cf633413f710 100644 --- a/tests/baselines/reference/symbolType11.symbols +++ b/tests/baselines/reference/symbolType11.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType11.ts === var s = Symbol.for("logical"); >s : Symbol(s, Decl(symbolType11.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) s && s; >s : Symbol(s, Decl(symbolType11.ts, 0, 3)) diff --git a/tests/baselines/reference/symbolType12.symbols b/tests/baselines/reference/symbolType12.symbols index 3cb844a8bfd8d..0367ac66fd589 100644 --- a/tests/baselines/reference/symbolType12.symbols +++ b/tests/baselines/reference/symbolType12.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType12.ts === var s = Symbol.for("assign"); >s : Symbol(s, Decl(symbolType12.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) var str = ""; >str : Symbol(str, Decl(symbolType12.ts, 1, 3)) diff --git a/tests/baselines/reference/symbolType13.symbols b/tests/baselines/reference/symbolType13.symbols index c9e22b5ed977a..ee332848f5d94 100644 --- a/tests/baselines/reference/symbolType13.symbols +++ b/tests/baselines/reference/symbolType13.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/es6/Symbols/symbolType13.ts === var s = Symbol(); >s : Symbol(s, Decl(symbolType13.ts, 0, 3)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) var x: any; >x : Symbol(x, Decl(symbolType13.ts, 1, 3)) diff --git a/tests/baselines/reference/symbolType14.symbols b/tests/baselines/reference/symbolType14.symbols index d06a62793650c..45620ffed2014 100644 --- a/tests/baselines/reference/symbolType14.symbols +++ b/tests/baselines/reference/symbolType14.symbols @@ -1,4 +1,4 @@ === tests/cases/conformance/es6/Symbols/symbolType14.ts === new Symbol(); ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolType15.symbols b/tests/baselines/reference/symbolType15.symbols index f6e2307305512..1c0cb19e2ca14 100644 --- a/tests/baselines/reference/symbolType15.symbols +++ b/tests/baselines/reference/symbolType15.symbols @@ -4,7 +4,7 @@ var sym: symbol; var symObj: Symbol; >symObj : Symbol(symObj, Decl(symbolType15.ts, 1, 3)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) symObj = sym; >symObj : Symbol(symObj, Decl(symbolType15.ts, 1, 3)) diff --git a/tests/baselines/reference/symbolType16.symbols b/tests/baselines/reference/symbolType16.symbols index 3e5fb6e2157a3..f722f5fea2fb7 100644 --- a/tests/baselines/reference/symbolType16.symbols +++ b/tests/baselines/reference/symbolType16.symbols @@ -1,6 +1,6 @@ === tests/cases/conformance/es6/Symbols/symbolType16.ts === interface Symbol { ->Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(symbolType16.ts, 0, 0)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(symbolType16.ts, 0, 0)) newSymbolProp: number; >newSymbolProp : Symbol(Symbol.newSymbolProp, Decl(symbolType16.ts, 0, 18)) diff --git a/tests/baselines/reference/symbolType2.symbols b/tests/baselines/reference/symbolType2.symbols index d0825e581b8ca..5931a71b32fae 100644 --- a/tests/baselines/reference/symbolType2.symbols +++ b/tests/baselines/reference/symbolType2.symbols @@ -1,11 +1,11 @@ === tests/cases/conformance/es6/Symbols/symbolType2.ts === Symbol.isConcatSpreadable in {}; ->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 : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>isConcatSpreadable : Symbol(SymbolConstructor.isConcatSpreadable, Decl(lib.es6.d.ts, --, --)) "" in Symbol.toPrimitive; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolType3.symbols b/tests/baselines/reference/symbolType3.symbols index 0403d9910aa41..2d4a45d6da343 100644 --- a/tests/baselines/reference/symbolType3.symbols +++ b/tests/baselines/reference/symbolType3.symbols @@ -1,22 +1,22 @@ === tests/cases/conformance/es6/Symbols/symbolType3.ts === var s = Symbol(); >s : Symbol(s, Decl(symbolType3.ts, 0, 3)) ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) delete Symbol.iterator; ->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.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es6.d.ts, --, --)) void Symbol.toPrimitive; ->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.toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toPrimitive : Symbol(SymbolConstructor.toPrimitive, Decl(lib.es6.d.ts, --, --)) typeof Symbol.toStringTag; ->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, --, --)) +>Symbol.toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>toStringTag : Symbol(SymbolConstructor.toStringTag, Decl(lib.es6.d.ts, --, --)) ++s; >s : Symbol(s, Decl(symbolType3.ts, 0, 3)) @@ -25,17 +25,17 @@ typeof Symbol.toStringTag; >s : Symbol(s, Decl(symbolType3.ts, 0, 3)) + Symbol(); ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) - Symbol(); ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) ~ Symbol(); ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) ! Symbol(); ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +(Symbol() || 0); ->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, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/symbolType4.symbols b/tests/baselines/reference/symbolType4.symbols index b1fd89595cfc9..e668afd6fa3db 100644 --- a/tests/baselines/reference/symbolType4.symbols +++ b/tests/baselines/reference/symbolType4.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType4.ts === var s = Symbol.for("postfix"); >s : Symbol(s, Decl(symbolType4.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) s++; >s : Symbol(s, Decl(symbolType4.ts, 0, 3)) diff --git a/tests/baselines/reference/symbolType5.symbols b/tests/baselines/reference/symbolType5.symbols index b1ccf915bd648..aa902bb668409 100644 --- a/tests/baselines/reference/symbolType5.symbols +++ b/tests/baselines/reference/symbolType5.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType5.ts === var s = Symbol.for("multiply"); >s : Symbol(s, Decl(symbolType5.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) s * s; >s : Symbol(s, Decl(symbolType5.ts, 0, 3)) diff --git a/tests/baselines/reference/symbolType6.symbols b/tests/baselines/reference/symbolType6.symbols index cc934b28337bf..4d823c8907a81 100644 --- a/tests/baselines/reference/symbolType6.symbols +++ b/tests/baselines/reference/symbolType6.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType6.ts === var s = Symbol.for("add"); >s : Symbol(s, Decl(symbolType6.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) var a: any; >a : Symbol(a, Decl(symbolType6.ts, 1, 3)) diff --git a/tests/baselines/reference/symbolType7.symbols b/tests/baselines/reference/symbolType7.symbols index ccd9d8ef449bb..f7733ac193638 100644 --- a/tests/baselines/reference/symbolType7.symbols +++ b/tests/baselines/reference/symbolType7.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType7.ts === var s = Symbol.for("shift"); >s : Symbol(s, Decl(symbolType7.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) s << s; >s : Symbol(s, Decl(symbolType7.ts, 0, 3)) diff --git a/tests/baselines/reference/symbolType8.symbols b/tests/baselines/reference/symbolType8.symbols index 32407ecbfd12b..00abf89c26ae0 100644 --- a/tests/baselines/reference/symbolType8.symbols +++ b/tests/baselines/reference/symbolType8.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType8.ts === var s = Symbol.for("compare"); >s : Symbol(s, Decl(symbolType8.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) s < s; >s : Symbol(s, Decl(symbolType8.ts, 0, 3)) diff --git a/tests/baselines/reference/symbolType9.symbols b/tests/baselines/reference/symbolType9.symbols index 48730edb891b2..4388254d569e5 100644 --- a/tests/baselines/reference/symbolType9.symbols +++ b/tests/baselines/reference/symbolType9.symbols @@ -1,9 +1,9 @@ === tests/cases/conformance/es6/Symbols/symbolType9.ts === var s = Symbol.for("equal"); >s : Symbol(s, Decl(symbolType9.ts, 0, 3)) ->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, --, --)) +>Symbol.for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) +>Symbol : Symbol(Symbol, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>for : Symbol(SymbolConstructor.for, Decl(lib.es6.d.ts, --, --)) s == s; >s : Symbol(s, Decl(symbolType9.ts, 0, 3)) diff --git a/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.symbols b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.symbols index 8501971115352..c0eaabecfd60b 100644 --- a/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.symbols +++ b/tests/baselines/reference/syntheticDefaultExportsWithDynamicImports.symbols @@ -8,9 +8,9 @@ export = packageExport; === tests/cases/compiler/index.ts === import("package").then(({default: foo}) => foo(42)); ->import("package").then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>import("package").then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >"package" : Symbol("tests/cases/compiler/node_modules/package/index", Decl(index.d.ts, 0, 0)) ->then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --)) +>then : Symbol(Promise.then, Decl(lib.es6.d.ts, --, --)) >default : Symbol(default) >foo : Symbol(foo, Decl(index.ts, 0, 25)) >foo : Symbol(foo, Decl(index.ts, 0, 25)) diff --git a/tests/baselines/reference/taggedTemplateContextualTyping1.symbols b/tests/baselines/reference/taggedTemplateContextualTyping1.symbols index 320c0e7447927..4f931dbb96ade 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping1.symbols +++ b/tests/baselines/reference/taggedTemplateContextualTyping1.symbols @@ -12,7 +12,7 @@ function tempTag1(templateStrs: TemplateStringsArray, f: FuncType, x: T): T; >tempTag1 : Symbol(tempTag1, Decl(taggedTemplateContextualTyping1.ts, 0, 48), Decl(taggedTemplateContextualTyping1.ts, 2, 79), Decl(taggedTemplateContextualTyping1.ts, 3, 92)) >T : Symbol(T, Decl(taggedTemplateContextualTyping1.ts, 2, 18)) >templateStrs : Symbol(templateStrs, Decl(taggedTemplateContextualTyping1.ts, 2, 21)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >f : Symbol(f, Decl(taggedTemplateContextualTyping1.ts, 2, 56)) >FuncType : Symbol(FuncType, Decl(taggedTemplateContextualTyping1.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplateContextualTyping1.ts, 2, 69)) @@ -23,7 +23,7 @@ function tempTag1(templateStrs: TemplateStringsArray, f: FuncType, h: FuncTyp >tempTag1 : Symbol(tempTag1, Decl(taggedTemplateContextualTyping1.ts, 0, 48), Decl(taggedTemplateContextualTyping1.ts, 2, 79), Decl(taggedTemplateContextualTyping1.ts, 3, 92)) >T : Symbol(T, Decl(taggedTemplateContextualTyping1.ts, 3, 18)) >templateStrs : Symbol(templateStrs, Decl(taggedTemplateContextualTyping1.ts, 3, 21)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >f : Symbol(f, Decl(taggedTemplateContextualTyping1.ts, 3, 56)) >FuncType : Symbol(FuncType, Decl(taggedTemplateContextualTyping1.ts, 0, 0)) >h : Symbol(h, Decl(taggedTemplateContextualTyping1.ts, 3, 69)) diff --git a/tests/baselines/reference/taggedTemplateContextualTyping2.symbols b/tests/baselines/reference/taggedTemplateContextualTyping2.symbols index 8c9459638d05e..950a39cfccc0e 100644 --- a/tests/baselines/reference/taggedTemplateContextualTyping2.symbols +++ b/tests/baselines/reference/taggedTemplateContextualTyping2.symbols @@ -21,7 +21,7 @@ type FuncType2 = (x: (p: T) => T) => typeof x; function tempTag2(templateStrs: TemplateStringsArray, f: FuncType1, x: number): number; >tempTag2 : Symbol(tempTag2, Decl(taggedTemplateContextualTyping2.ts, 1, 52), Decl(taggedTemplateContextualTyping2.ts, 3, 87), Decl(taggedTemplateContextualTyping2.ts, 4, 101)) >templateStrs : Symbol(templateStrs, Decl(taggedTemplateContextualTyping2.ts, 3, 18)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >f : Symbol(f, Decl(taggedTemplateContextualTyping2.ts, 3, 53)) >FuncType1 : Symbol(FuncType1, Decl(taggedTemplateContextualTyping2.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplateContextualTyping2.ts, 3, 67)) @@ -29,7 +29,7 @@ function tempTag2(templateStrs: TemplateStringsArray, f: FuncType1, x: number): function tempTag2(templateStrs: TemplateStringsArray, f: FuncType2, h: FuncType2, x: string): string; >tempTag2 : Symbol(tempTag2, Decl(taggedTemplateContextualTyping2.ts, 1, 52), Decl(taggedTemplateContextualTyping2.ts, 3, 87), Decl(taggedTemplateContextualTyping2.ts, 4, 101)) >templateStrs : Symbol(templateStrs, Decl(taggedTemplateContextualTyping2.ts, 4, 18)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >f : Symbol(f, Decl(taggedTemplateContextualTyping2.ts, 4, 53)) >FuncType2 : Symbol(FuncType2, Decl(taggedTemplateContextualTyping2.ts, 0, 49)) >h : Symbol(h, Decl(taggedTemplateContextualTyping2.ts, 4, 67)) diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.symbols b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.symbols index 6594dcf1afad3..f4170c38d2682 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.symbols +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.symbols @@ -293,7 +293,7 @@ interface A92 { z?: Date; >z : Symbol(A92.z, Decl(taggedTemplateStringsTypeArgumentInference.ts, 70, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; @@ -302,7 +302,7 @@ var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: >undefined : Symbol(undefined) >x : Symbol(x, Decl(taggedTemplateStringsTypeArgumentInference.ts, 74, 43)) >z : Symbol(z, Decl(taggedTemplateStringsTypeArgumentInference.ts, 74, 49)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(taggedTemplateStringsTypeArgumentInference.ts, 74, 71)) >y : Symbol(y, Decl(taggedTemplateStringsTypeArgumentInference.ts, 74, 77)) diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.symbols b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.symbols index bafb4ac9837ef..79f294e0d9261 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.symbols +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.symbols @@ -14,7 +14,7 @@ function noGenericParams(n: TemplateStringsArray) { } >noGenericParams : Symbol(noGenericParams, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 2, 12)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 5, 25)) >n : Symbol(n, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 5, 28)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) noGenericParams ``; >noGenericParams : Symbol(noGenericParams, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 2, 12)) @@ -36,7 +36,7 @@ function someGenerics1b(n: TemplateStringsArray, m: U) { } >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 12, 24)) >U : Symbol(U, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 12, 26)) >n : Symbol(n, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 12, 30)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >m : Symbol(m, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 12, 54)) >U : Symbol(U, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 12, 26)) @@ -48,7 +48,7 @@ function someGenerics2a(strs: TemplateStringsArray, n: (x: T) => void) { } >someGenerics2a : Symbol(someGenerics2a, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 13, 22)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 16, 24)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 16, 27)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 16, 54)) >x : Symbol(x, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 16, 59)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 16, 24)) @@ -63,7 +63,7 @@ function someGenerics2b(strs: TemplateStringsArray, n: (x: T, y: U) => voi >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 19, 24)) >U : Symbol(U, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 19, 26)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 19, 30)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 19, 57)) >x : Symbol(x, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 19, 62)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 19, 24)) @@ -81,7 +81,7 @@ function someGenerics3(strs: TemplateStringsArray, producer: () => T) { } >someGenerics3 : Symbol(someGenerics3, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 20, 50)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 23, 23)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 23, 26)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >producer : Symbol(producer, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 23, 53)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 23, 23)) @@ -101,7 +101,7 @@ function someGenerics4(strs: TemplateStringsArray, n: T, f: (x: U) => void >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 29, 23)) >U : Symbol(U, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 29, 25)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 29, 29)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 29, 56)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 29, 23)) >f : Symbol(f, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 29, 62)) @@ -123,7 +123,7 @@ function someGenerics5(strs: TemplateStringsArray, n: T, f: (x: U) => void >U : Symbol(U, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 35, 23)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 35, 25)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 35, 29)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 35, 56)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 35, 25)) >f : Symbol(f, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 35, 62)) @@ -144,7 +144,7 @@ function someGenerics6(strs: TemplateStringsArray, a: (a: A) => A, b: (b: A) >someGenerics6 : Symbol(someGenerics6, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 38, 31)) >A : Symbol(A, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 41, 23)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 41, 26)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 41, 53)) >a : Symbol(a, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 41, 58)) >A : Symbol(A, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 41, 23)) @@ -192,7 +192,7 @@ function someGenerics7(strs: TemplateStringsArray, a: (a: A) => A, b: ( >B : Symbol(B, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 47, 25)) >C : Symbol(C, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 47, 28)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 47, 32)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 47, 59)) >a : Symbol(a, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 47, 64)) >A : Symbol(A, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 47, 23)) @@ -238,7 +238,7 @@ function someGenerics8(strs: TemplateStringsArray, n: T): T { return n; } >someGenerics8 : Symbol(someGenerics8, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 50, 76)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 53, 23)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 53, 26)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 53, 53)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 53, 23)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 53, 23)) @@ -257,7 +257,7 @@ function someGenerics9(strs: TemplateStringsArray, a: T, b: T, c: T): T { >someGenerics9 : Symbol(someGenerics9, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 55, 26)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 58, 23)) >strs : Symbol(strs, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 58, 26)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >a : Symbol(a, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 58, 53)) >T : Symbol(T, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 58, 23)) >b : Symbol(b, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 58, 59)) @@ -293,7 +293,7 @@ interface A92 { z?: Date; >z : Symbol(A92.z, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 70, 14)) ->Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) } var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: '' } }`; @@ -302,7 +302,7 @@ var a9e = someGenerics9 `${ undefined }${ { x: 6, z: new Date() } }${ { x: 6, y: >undefined : Symbol(undefined) >x : Symbol(x, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 74, 43)) >z : Symbol(z, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 74, 49)) ->Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 74, 71)) >y : Symbol(y, Decl(taggedTemplateStringsTypeArgumentInferenceES6.ts, 74, 77)) diff --git a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.symbols b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.symbols index 5ec23bae79a3a..848ed7682f81a 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithIncompatibleTypedTagsES6.symbols @@ -4,7 +4,7 @@ interface I { (stringParts: TemplateStringsArray, ...rest: boolean[]): I; >stringParts : Symbol(stringParts, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 1, 5)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >rest : Symbol(rest, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 1, 39)) >I : Symbol(I, Decl(taggedTemplateStringsWithIncompatibleTypedTagsES6.ts, 0, 0)) diff --git a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.symbols b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.symbols index 0d163daa640e2..1a81f4c36a082 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithManyCallAndMemberExpressionsES6.symbols @@ -4,7 +4,7 @@ interface I { (strs: TemplateStringsArray, ...subs: number[]): I; >strs : Symbol(strs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 5)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >subs : Symbol(subs, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 1, 32)) >I : Symbol(I, Decl(taggedTemplateStringsWithManyCallAndMemberExpressionsES6.ts, 0, 0)) diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.symbols b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.symbols index fad61bd5e7d7d..2f45654ce6206 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.symbols @@ -2,25 +2,25 @@ function foo(strs: TemplateStringsArray): number; >foo : Symbol(foo, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 49), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 1, 60), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 2, 72), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 3, 67)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) function foo(strs: TemplateStringsArray, x: number): string; >foo : Symbol(foo, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 49), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 1, 60), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 2, 72), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 3, 67)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 1, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 1, 40)) function foo(strs: TemplateStringsArray, x: number, y: number): boolean; >foo : Symbol(foo, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 49), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 1, 60), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 2, 72), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 3, 67)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 2, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 2, 40)) >y : Symbol(y, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 2, 51)) function foo(strs: TemplateStringsArray, x: number, y: string): {}; >foo : Symbol(foo, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 0, 49), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 1, 60), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 2, 72), Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 3, 67)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 3, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 3, 40)) >y : Symbol(y, Decl(taggedTemplateStringsWithOverloadResolution1_ES6.ts, 3, 51)) diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.symbols b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.symbols index 9cc79f2596f1e..c124db958dac0 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution2_ES6.symbols @@ -2,7 +2,7 @@ function foo1(strs: TemplateStringsArray, x: number): string; >foo1 : Symbol(foo1, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 61), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 1, 49)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 14)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 0, 41)) function foo1(strs: string[], x: number): number; @@ -34,7 +34,7 @@ function foo2(strs: string[], x: number): number; function foo2(strs: TemplateStringsArray, x: number): string; >foo2 : Symbol(foo2, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 7, 20), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 9, 49), Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 10, 61)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 10, 14)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >x : Symbol(x, Decl(taggedTemplateStringsWithOverloadResolution2_ES6.ts, 10, 41)) function foo2(...stuff: any[]): any { diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.symbols b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.symbols index c9dc30d3a2d65..07b5228bae013 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3.symbols @@ -47,7 +47,7 @@ function fn2() { return undefined; } var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed >d1 : Symbol(d1, Decl(taggedTemplateStringsWithOverloadResolution3.ts, 14, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >fn2 : Symbol(fn2, Decl(taggedTemplateStringsWithOverloadResolution3.ts, 8, 14), Decl(taggedTemplateStringsWithOverloadResolution3.ts, 10, 71), Decl(taggedTemplateStringsWithOverloadResolution3.ts, 11, 64)) >undefined : Symbol(undefined) diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.symbols b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.symbols index 01c9696c312c4..fb19ebbb4c9c2 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.symbols @@ -3,13 +3,13 @@ function fn1(strs: TemplateStringsArray, s: string): string; >fn1 : Symbol(fn1, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 1, 60), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 2, 60)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 1, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 1, 40)) function fn1(strs: TemplateStringsArray, n: number): number; >fn1 : Symbol(fn1, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 0, 0), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 1, 60), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 2, 60)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 2, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 2, 40)) function fn1() { return null; } @@ -27,7 +27,7 @@ fn1 `${ {} }`; // Error function fn2(strs: TemplateStringsArray, s: string, n: number): number; >fn2 : Symbol(fn2, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 8, 14), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 10, 71), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 11, 64)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 10, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 10, 40)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 10, 51)) @@ -35,7 +35,7 @@ function fn2(strs: TemplateStringsArray, n: number, t: T): T; >fn2 : Symbol(fn2, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 8, 14), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 10, 71), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 11, 64)) >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 11, 13)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 11, 16)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 11, 43)) >t : Symbol(t, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 11, 54)) >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 11, 13)) @@ -47,7 +47,7 @@ function fn2() { return undefined; } var d1: Date = fn2 `${ 0 }${ undefined }`; // contextually typed >d1 : Symbol(d1, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 14, 3)) ->Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >fn2 : Symbol(fn2, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 8, 14), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 10, 71), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 11, 64)) >undefined : Symbol(undefined) @@ -75,7 +75,7 @@ function fn3(strs: TemplateStringsArray, n: T): string; >fn3 : Symbol(fn3, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 24, 20), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 27, 58), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 28, 73), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 29, 76)) >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 27, 13)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 27, 16)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 27, 43)) >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 27, 13)) @@ -84,7 +84,7 @@ function fn3(strs: TemplateStringsArray, s: string, t: T, u: U): U; >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 28, 13)) >U : Symbol(U, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 28, 15)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 28, 19)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >s : Symbol(s, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 28, 46)) >t : Symbol(t, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 28, 57)) >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 28, 13)) @@ -98,7 +98,7 @@ function fn3(strs: TemplateStringsArray, v: V, u: U, t: T): number; >U : Symbol(U, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 29, 15)) >V : Symbol(V, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 29, 18)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 29, 22)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >v : Symbol(v, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 29, 49)) >V : Symbol(V, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 29, 18)) >u : Symbol(u, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 29, 55)) @@ -147,7 +147,7 @@ function fn4(strs: TemplateStringsArray, n: >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 46, 13)) >U : Symbol(U, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 46, 30)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 46, 49)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 46, 76)) >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 46, 13)) >m : Symbol(m, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 46, 82)) @@ -158,7 +158,7 @@ function fn4(strs: TemplateStringsArray, n: >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 47, 13)) >U : Symbol(U, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 47, 30)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 47, 49)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 47, 76)) >T : Symbol(T, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 47, 13)) >m : Symbol(m, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 47, 82)) @@ -167,7 +167,7 @@ function fn4(strs: TemplateStringsArray, n: function fn4(strs: TemplateStringsArray) >fn4 : Symbol(fn4, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 43, 7), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 46, 89), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 47, 89), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 48, 40)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 48, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) function fn4() { } >fn4 : Symbol(fn4, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 43, 7), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 46, 89), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 47, 89), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 48, 40)) @@ -201,14 +201,14 @@ fn4 `${ null }${ true }`; function fn5(strs: TemplateStringsArray, f: (n: string) => void): string; >fn5 : Symbol(fn5, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 62, 25), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 65, 73), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 66, 73)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 65, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >f : Symbol(f, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 65, 40)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 65, 45)) function fn5(strs: TemplateStringsArray, f: (n: number) => void): number; >fn5 : Symbol(fn5, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 62, 25), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 65, 73), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 66, 73)) >strs : Symbol(strs, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 66, 13)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >f : Symbol(f, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 66, 40)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 66, 45)) @@ -224,8 +224,8 @@ fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. fn5 `${ (n) => n.substr(0) }`; >fn5 : Symbol(fn5, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 62, 25), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 65, 73), Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 66, 73)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 69, 9)) ->n.substr : Symbol(String.substr, Decl(lib.es5.d.ts, --, --)) +>n.substr : Symbol(String.substr, Decl(lib.es6.d.ts, --, --)) >n : Symbol(n, Decl(taggedTemplateStringsWithOverloadResolution3_ES6.ts, 69, 9)) ->substr : Symbol(String.substr, Decl(lib.es5.d.ts, --, --)) +>substr : Symbol(String.substr, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.symbols b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.symbols index f7f9c62d492a1..64be0db1a926e 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.symbols +++ b/tests/baselines/reference/taggedTemplateStringsWithTypedTagsES6.symbols @@ -4,7 +4,7 @@ interface I { (stringParts: TemplateStringsArray, ...rest: number[]): I; >stringParts : Symbol(stringParts, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 5)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >rest : Symbol(rest, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 1, 39)) >I : Symbol(I, Decl(taggedTemplateStringsWithTypedTagsES6.ts, 0, 0)) diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.symbols b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.symbols index 4735c33e421e7..7daa576a25efe 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.symbols +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.symbols @@ -2,7 +2,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { >f : Symbol(f, Decl(taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts, 0, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts, 0, 35)) >z : Symbol(z, Decl(taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts, 0, 46)) } diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.symbols b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.symbols index f0cf4b20af3fd..3262b1dcad5ab 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.symbols +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.symbols @@ -2,7 +2,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { >f : Symbol(f, Decl(taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts, 0, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts, 0, 35)) >z : Symbol(z, Decl(taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts, 0, 46)) } diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.symbols b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.symbols index 4f41bcd748e29..946026220eaea 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.symbols +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions1.symbols @@ -2,7 +2,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { >f : Symbol(f, Decl(taggedTemplatesWithIncompleteTemplateExpressions1.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplatesWithIncompleteTemplateExpressions1.ts, 0, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(taggedTemplatesWithIncompleteTemplateExpressions1.ts, 0, 35)) >z : Symbol(z, Decl(taggedTemplatesWithIncompleteTemplateExpressions1.ts, 0, 46)) } diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.symbols b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.symbols index 90316388c50f3..051a8a2706f55 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.symbols +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions2.symbols @@ -2,7 +2,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { >f : Symbol(f, Decl(taggedTemplatesWithIncompleteTemplateExpressions2.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplatesWithIncompleteTemplateExpressions2.ts, 0, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(taggedTemplatesWithIncompleteTemplateExpressions2.ts, 0, 35)) >z : Symbol(z, Decl(taggedTemplatesWithIncompleteTemplateExpressions2.ts, 0, 46)) } diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.symbols b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.symbols index 35629254802d0..a51594b3772f0 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.symbols +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions3.symbols @@ -2,7 +2,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { >f : Symbol(f, Decl(taggedTemplatesWithIncompleteTemplateExpressions3.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplatesWithIncompleteTemplateExpressions3.ts, 0, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(taggedTemplatesWithIncompleteTemplateExpressions3.ts, 0, 35)) >z : Symbol(z, Decl(taggedTemplatesWithIncompleteTemplateExpressions3.ts, 0, 46)) } diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.symbols b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.symbols index ba814b71c972f..88dab945db001 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.symbols +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions4.symbols @@ -2,7 +2,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { >f : Symbol(f, Decl(taggedTemplatesWithIncompleteTemplateExpressions4.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplatesWithIncompleteTemplateExpressions4.ts, 0, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(taggedTemplatesWithIncompleteTemplateExpressions4.ts, 0, 35)) >z : Symbol(z, Decl(taggedTemplatesWithIncompleteTemplateExpressions4.ts, 0, 46)) } diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.symbols b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.symbols index d9cc96fd93f15..9152de0026bcb 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.symbols +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions5.symbols @@ -2,7 +2,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { >f : Symbol(f, Decl(taggedTemplatesWithIncompleteTemplateExpressions5.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplatesWithIncompleteTemplateExpressions5.ts, 0, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(taggedTemplatesWithIncompleteTemplateExpressions5.ts, 0, 35)) >z : Symbol(z, Decl(taggedTemplatesWithIncompleteTemplateExpressions5.ts, 0, 46)) } diff --git a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.symbols b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.symbols index 6a18e12c08f6c..608273563aa91 100644 --- a/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.symbols +++ b/tests/baselines/reference/taggedTemplatesWithIncompleteTemplateExpressions6.symbols @@ -2,7 +2,7 @@ function f(x: TemplateStringsArray, y: string, z: string) { >f : Symbol(f, Decl(taggedTemplatesWithIncompleteTemplateExpressions6.ts, 0, 0)) >x : Symbol(x, Decl(taggedTemplatesWithIncompleteTemplateExpressions6.ts, 0, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --)) >y : Symbol(y, Decl(taggedTemplatesWithIncompleteTemplateExpressions6.ts, 0, 35)) >z : Symbol(z, Decl(taggedTemplatesWithIncompleteTemplateExpressions6.ts, 0, 46)) } diff --git a/tests/baselines/reference/templateStringInInstanceOfES6.symbols b/tests/baselines/reference/templateStringInInstanceOfES6.symbols index bc6379c6ef4f6..9580d7c069d87 100644 --- a/tests/baselines/reference/templateStringInInstanceOfES6.symbols +++ b/tests/baselines/reference/templateStringInInstanceOfES6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringInInstanceOfES6.ts === var x = `abc${ 0 }def` instanceof String; >x : Symbol(x, Decl(templateStringInInstanceOfES6.ts, 0, 3)) ->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) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) diff --git a/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.symbols b/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.symbols index 9bd564f089e4d..ab2e5d8094e6f 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.symbols +++ b/tests/baselines/reference/templateStringWithEmbeddedInstanceOfES6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedInstanceOfES6.ts === var x = `abc${ "hello" instanceof String }def`; >x : Symbol(x, Decl(templateStringWithEmbeddedInstanceOfES6.ts, 0, 3)) ->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) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) diff --git a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.symbols b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.symbols index 9c29590b783d8..b597bc5e6d704 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.symbols +++ b/tests/baselines/reference/templateStringWithEmbeddedNewOperatorES6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedNewOperatorES6.ts === var x = `abc${ new String("Hi") }def`; >x : Symbol(x, Decl(templateStringWithEmbeddedNewOperatorES6.ts, 0, 3)) ->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) +>String : Symbol(String, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --) ... and 1 more) diff --git a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.symbols b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.symbols index df10fbfca6de9..06a1acd210bef 100644 --- a/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.symbols +++ b/tests/baselines/reference/templateStringWithEmbeddedUnaryPlusES6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringWithEmbeddedUnaryPlusES6.ts === var x = `abc${ +Infinity }def`; >x : Symbol(x, Decl(templateStringWithEmbeddedUnaryPlusES6.ts, 0, 3)) ->Infinity : Symbol(Infinity, Decl(lib.es5.d.ts, --, --)) +>Infinity : Symbol(Infinity, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/templateStringWithPropertyAccessES6.symbols b/tests/baselines/reference/templateStringWithPropertyAccessES6.symbols index 803705609a1f6..4638a3813b912 100644 --- a/tests/baselines/reference/templateStringWithPropertyAccessES6.symbols +++ b/tests/baselines/reference/templateStringWithPropertyAccessES6.symbols @@ -1,5 +1,5 @@ === tests/cases/conformance/es6/templates/templateStringWithPropertyAccessES6.ts === `abc${0}abc`.indexOf(`abc`); ->`abc${0}abc`.indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --)) ->indexOf : Symbol(String.indexOf, Decl(lib.es5.d.ts, --, --)) +>`abc${0}abc`.indexOf : Symbol(String.indexOf, Decl(lib.es6.d.ts, --, --)) +>indexOf : Symbol(String.indexOf, Decl(lib.es6.d.ts, --, --)) diff --git a/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.symbols b/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.symbols index f65f949fcb9b8..225f7c9b12279 100644 --- a/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.symbols +++ b/tests/baselines/reference/templateStringsArrayTypeRedefinedInES6Mode.symbols @@ -1,12 +1,12 @@ === tests/cases/compiler/templateStringsArrayTypeRedefinedInES6Mode.ts === class TemplateStringsArray { ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --), Decl(templateStringsArrayTypeRedefinedInES6Mode.ts, 0, 0)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --), Decl(templateStringsArrayTypeRedefinedInES6Mode.ts, 0, 0)) } function f(x: TemplateStringsArray, y: number, z: number) { >f : Symbol(f, Decl(templateStringsArrayTypeRedefinedInES6Mode.ts, 1, 1)) >x : Symbol(x, Decl(templateStringsArrayTypeRedefinedInES6Mode.ts, 3, 11)) ->TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es5.d.ts, --, --), Decl(templateStringsArrayTypeRedefinedInES6Mode.ts, 0, 0)) +>TemplateStringsArray : Symbol(TemplateStringsArray, Decl(lib.es6.d.ts, --, --), Decl(templateStringsArrayTypeRedefinedInES6Mode.ts, 0, 0)) >y : Symbol(y, Decl(templateStringsArrayTypeRedefinedInES6Mode.ts, 3, 35)) >z : Symbol(z, Decl(templateStringsArrayTypeRedefinedInES6Mode.ts, 3, 46)) } diff --git a/tests/baselines/reference/thisBinding2.symbols b/tests/baselines/reference/thisBinding2.symbols index f8436f5248bf1..3404ad6947323 100644 --- a/tests/baselines/reference/thisBinding2.symbols +++ b/tests/baselines/reference/thisBinding2.symbols @@ -33,7 +33,7 @@ class C { } } declare function setTimeout(expression: any, msec?: number, language?: any): number; ->setTimeout : Symbol(setTimeout, Decl(thisBinding2.ts, 12, 1)) +>setTimeout : Symbol(setTimeout, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisBinding2.ts, 12, 1)) >expression : Symbol(expression, Decl(thisBinding2.ts, 13, 28)) >msec : Symbol(msec, Decl(thisBinding2.ts, 13, 44)) >language : Symbol(language, Decl(thisBinding2.ts, 13, 59)) @@ -48,7 +48,7 @@ var messenger = { >start : Symbol(start, Decl(thisBinding2.ts, 15, 27)) return setTimeout(() => { var x = this.message; }, 3000); ->setTimeout : Symbol(setTimeout, Decl(thisBinding2.ts, 12, 1)) +>setTimeout : Symbol(setTimeout, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(thisBinding2.ts, 12, 1)) >x : Symbol(x, Decl(thisBinding2.ts, 17, 37)) >this.message : Symbol(message, Decl(thisBinding2.ts, 14, 17)) >this : Symbol(messenger, Decl(thisBinding2.ts, 14, 15)) diff --git a/tests/baselines/reference/thisBinding2.types b/tests/baselines/reference/thisBinding2.types index 4889e6d3b3386..72cf2d07283fb 100644 --- a/tests/baselines/reference/thisBinding2.types +++ b/tests/baselines/reference/thisBinding2.types @@ -46,7 +46,7 @@ class C { } } declare function setTimeout(expression: any, msec?: number, language?: any): number; ->setTimeout : (expression: any, msec?: number, language?: any) => number +>setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; (expression: any, msec?: number, language?: any): number; } >expression : any >msec : number >language : any @@ -65,7 +65,7 @@ var messenger = { return setTimeout(() => { var x = this.message; }, 3000); >setTimeout(() => { var x = this.message; }, 3000) : number ->setTimeout : (expression: any, msec?: number, language?: any) => number +>setTimeout : { (handler: (...args: any[]) => void, timeout: number): number; (handler: any, timeout?: any, ...args: any[]): number; (expression: any, msec?: number, language?: any): number; } >() => { var x = this.message; } : () => void >x : string >this.message : string diff --git a/tests/baselines/reference/thisTypeInClasses.symbols b/tests/baselines/reference/thisTypeInClasses.symbols index 0f98f013b01d3..df8ffe927dfa2 100644 --- a/tests/baselines/reference/thisTypeInClasses.symbols +++ b/tests/baselines/reference/thisTypeInClasses.symbols @@ -41,11 +41,11 @@ class C3 { c: this | Date; >c : Symbol(C3.c, Decl(thisTypeInClasses.ts, 16, 20)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) d: this & Date; >d : Symbol(C3.d, Decl(thisTypeInClasses.ts, 17, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) e: (((this))); >e : Symbol(C3.e, Decl(thisTypeInClasses.ts, 18, 19)) diff --git a/tests/baselines/reference/thisTypeInInterfaces.symbols b/tests/baselines/reference/thisTypeInInterfaces.symbols index 286447a7083c8..3b02bbe35886d 100644 --- a/tests/baselines/reference/thisTypeInInterfaces.symbols +++ b/tests/baselines/reference/thisTypeInInterfaces.symbols @@ -46,11 +46,11 @@ interface I3 { c: this | Date; >c : Symbol(I3.c, Decl(thisTypeInInterfaces.ts, 18, 20)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) d: this & Date; >d : Symbol(I3.d, Decl(thisTypeInInterfaces.ts, 19, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) e: (((this))); >e : Symbol(I3.e, Decl(thisTypeInInterfaces.ts, 20, 19)) diff --git a/tests/baselines/reference/throwStatements.symbols b/tests/baselines/reference/throwStatements.symbols index e4d09aeb0e831..0aee36306542b 100644 --- a/tests/baselines/reference/throwStatements.symbols +++ b/tests/baselines/reference/throwStatements.symbols @@ -72,7 +72,7 @@ throw aString; var aDate = new Date(12); >aDate : Symbol(aDate, Decl(throwStatements.ts, 30, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) throw aDate; >aDate : Symbol(aDate, Decl(throwStatements.ts, 30, 3)) @@ -202,7 +202,7 @@ throw []; throw ['a', ['b']]; throw /[a-z]/; throw new Date(); ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) throw new C(); >C : Symbol(C, Decl(throwStatements.ts, 4, 1)) diff --git a/tests/baselines/reference/tooManyTypeParameters1.symbols b/tests/baselines/reference/tooManyTypeParameters1.symbols index c7d7cf3ae3841..761028be41ca4 100644 --- a/tests/baselines/reference/tooManyTypeParameters1.symbols +++ b/tests/baselines/reference/tooManyTypeParameters1.symbols @@ -20,8 +20,8 @@ class C {} var c = new C(); >c : Symbol(c, Decl(tooManyTypeParameters1.ts, 7, 3)) >C : Symbol(C, Decl(tooManyTypeParameters1.ts, 4, 19)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) interface I {} >I : Symbol(I, Decl(tooManyTypeParameters1.ts, 7, 27)) diff --git a/tests/baselines/reference/twoGenericInterfacesWithDifferentConstraints.symbols b/tests/baselines/reference/twoGenericInterfacesWithDifferentConstraints.symbols index 46b0d397e09e4..2232397921718 100644 --- a/tests/baselines/reference/twoGenericInterfacesWithDifferentConstraints.symbols +++ b/tests/baselines/reference/twoGenericInterfacesWithDifferentConstraints.symbols @@ -2,7 +2,7 @@ interface A { >A : Symbol(A, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 0, 0), Decl(twoGenericInterfacesWithDifferentConstraints.ts, 2, 1)) >T : Symbol(T, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 0, 12), Decl(twoGenericInterfacesWithDifferentConstraints.ts, 4, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) x: T; >x : Symbol(A.x, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 0, 29)) @@ -26,7 +26,7 @@ module M { >B : Symbol(B, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 8, 10), Decl(twoGenericInterfacesWithDifferentConstraints.ts, 11, 5)) >T : Symbol(T, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 9, 16), Decl(twoGenericInterfacesWithDifferentConstraints.ts, 13, 16)) >A : Symbol(A, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 0, 0), Decl(twoGenericInterfacesWithDifferentConstraints.ts, 2, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) x: T; >x : Symbol(B.x, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 9, 36)) @@ -50,7 +50,7 @@ module M2 { interface A { >A : Symbol(A, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 18, 11)) >T : Symbol(T, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 19, 16)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) x: T; >x : Symbol(A.x, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 19, 33)) @@ -78,7 +78,7 @@ module M3 { export interface A { >A : Symbol(A, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 30, 11), Decl(twoGenericInterfacesWithDifferentConstraints.ts, 36, 11)) >T : Symbol(T, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 31, 23), Decl(twoGenericInterfacesWithDifferentConstraints.ts, 37, 23)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) x: T; >x : Symbol(A.x, Decl(twoGenericInterfacesWithDifferentConstraints.ts, 31, 40)) diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.symbols b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.symbols index b93de8e55ce90..34900916a5665 100644 --- a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.symbols +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.symbols @@ -19,8 +19,8 @@ interface A { foo(x: Date): Date; >foo : Symbol(A.foo, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 2, 13), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 3, 27), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 7, 13)) >x : Symbol(x, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 8, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } interface B { @@ -45,12 +45,12 @@ interface B { >foo : Symbol(B.foo, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 11, 16), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 12, 22), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 16, 16), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 17, 20)) >x : Symbol(x, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 17, 8)) >T : Symbol(T, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 11, 12), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 16, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo(x: Date): string; >foo : Symbol(B.foo, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 11, 16), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 12, 22), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 16, 16), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 17, 20)) >x : Symbol(x, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 18, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var b: B; @@ -100,7 +100,7 @@ interface C { var c: C; >c : Symbol(c, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 34, 3)) >C : Symbol(C, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 22, 20), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 28, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r2 = c.foo(1, 2); // number >r2 : Symbol(r2, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 35, 3)) @@ -150,7 +150,7 @@ interface D { var d: D; >d : Symbol(d, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 48, 3)) >D : Symbol(D, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 35, 21), Decl(twoMergedInterfacesWithDifferingOverloads.ts, 42, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var r3 = d.foo(1, 1); // boolean, last definition wins >r3 : Symbol(r3, Decl(twoMergedInterfacesWithDifferingOverloads.ts, 49, 3)) diff --git a/tests/baselines/reference/typeArgumentConstraintResolution1.symbols b/tests/baselines/reference/typeArgumentConstraintResolution1.symbols index 66868e80c731a..3f32ab58f3b59 100644 --- a/tests/baselines/reference/typeArgumentConstraintResolution1.symbols +++ b/tests/baselines/reference/typeArgumentConstraintResolution1.symbols @@ -2,7 +2,7 @@ function foo1(test: T); >foo1 : Symbol(foo1, Decl(typeArgumentConstraintResolution1.ts, 0, 0), Decl(typeArgumentConstraintResolution1.ts, 0, 39), Decl(typeArgumentConstraintResolution1.ts, 1, 46)) >T : Symbol(T, Decl(typeArgumentConstraintResolution1.ts, 0, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >test : Symbol(test, Decl(typeArgumentConstraintResolution1.ts, 0, 30)) >T : Symbol(T, Decl(typeArgumentConstraintResolution1.ts, 0, 14)) @@ -20,14 +20,14 @@ function foo1(test: any) { } foo1(""); // should error >foo1 : Symbol(foo1, Decl(typeArgumentConstraintResolution1.ts, 0, 0), Decl(typeArgumentConstraintResolution1.ts, 0, 39), Decl(typeArgumentConstraintResolution1.ts, 1, 46)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function foo2(test: T): T; >foo2 : Symbol(foo2, Decl(typeArgumentConstraintResolution1.ts, 3, 15), Decl(typeArgumentConstraintResolution1.ts, 7, 42), Decl(typeArgumentConstraintResolution1.ts, 8, 49)) >T : Symbol(T, Decl(typeArgumentConstraintResolution1.ts, 7, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >test : Symbol(test, Decl(typeArgumentConstraintResolution1.ts, 7, 30)) >T : Symbol(T, Decl(typeArgumentConstraintResolution1.ts, 7, 14)) >T : Symbol(T, Decl(typeArgumentConstraintResolution1.ts, 7, 14)) @@ -47,5 +47,5 @@ function foo2(test: any): any { return null; } foo2(""); // Type Date does not satisfy the constraint 'Number' for type parameter 'T extends Number' >foo2 : Symbol(foo2, Decl(typeArgumentConstraintResolution1.ts, 3, 15), Decl(typeArgumentConstraintResolution1.ts, 7, 42), Decl(typeArgumentConstraintResolution1.ts, 8, 49)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/typeArgumentInference.symbols b/tests/baselines/reference/typeArgumentInference.symbols index 001fb619e00dc..4b37b4ca6f821 100644 --- a/tests/baselines/reference/typeArgumentInference.symbols +++ b/tests/baselines/reference/typeArgumentInference.symbols @@ -112,7 +112,7 @@ someGenerics3(() => ''); someGenerics3(() => undefined); >someGenerics3 : Symbol(someGenerics3, Decl(typeArgumentInference.ts, 26, 58)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) someGenerics3(() => 3); @@ -317,7 +317,7 @@ interface A92 { z?: Date; >z : Symbol(A92.z, Decl(typeArgumentInference.ts, 78, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); >a9e : Symbol(a9e, Decl(typeArgumentInference.ts, 81, 3), Decl(typeArgumentInference.ts, 82, 3)) @@ -325,7 +325,7 @@ var a9e = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); >undefined : Symbol(undefined) >x : Symbol(x, Decl(typeArgumentInference.ts, 81, 36)) >z : Symbol(z, Decl(typeArgumentInference.ts, 81, 42)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeArgumentInference.ts, 81, 61)) >y : Symbol(y, Decl(typeArgumentInference.ts, 81, 67)) @@ -339,7 +339,7 @@ var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' } >undefined : Symbol(undefined) >x : Symbol(x, Decl(typeArgumentInference.ts, 83, 41)) >z : Symbol(z, Decl(typeArgumentInference.ts, 83, 47)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeArgumentInference.ts, 83, 66)) >y : Symbol(y, Decl(typeArgumentInference.ts, 83, 72)) diff --git a/tests/baselines/reference/typeArgumentInferenceApparentType1.symbols b/tests/baselines/reference/typeArgumentInferenceApparentType1.symbols index c9ef38b3c5ce1..7fe379bdcf2b5 100644 --- a/tests/baselines/reference/typeArgumentInferenceApparentType1.symbols +++ b/tests/baselines/reference/typeArgumentInferenceApparentType1.symbols @@ -3,7 +3,7 @@ function method(iterable: Iterable): T { >method : Symbol(method, Decl(typeArgumentInferenceApparentType1.ts, 0, 0)) >T : Symbol(T, Decl(typeArgumentInferenceApparentType1.ts, 0, 16)) >iterable : Symbol(iterable, Decl(typeArgumentInferenceApparentType1.ts, 0, 19)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(typeArgumentInferenceApparentType1.ts, 0, 16)) >T : Symbol(T, Decl(typeArgumentInferenceApparentType1.ts, 0, 16)) diff --git a/tests/baselines/reference/typeArgumentInferenceApparentType2.symbols b/tests/baselines/reference/typeArgumentInferenceApparentType2.symbols index f257b3596bae7..75664a7b14e14 100644 --- a/tests/baselines/reference/typeArgumentInferenceApparentType2.symbols +++ b/tests/baselines/reference/typeArgumentInferenceApparentType2.symbols @@ -3,14 +3,14 @@ function method(iterable: Iterable): T { >method : Symbol(method, Decl(typeArgumentInferenceApparentType2.ts, 0, 0)) >T : Symbol(T, Decl(typeArgumentInferenceApparentType2.ts, 0, 16)) >iterable : Symbol(iterable, Decl(typeArgumentInferenceApparentType2.ts, 0, 19)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(typeArgumentInferenceApparentType2.ts, 0, 16)) >T : Symbol(T, Decl(typeArgumentInferenceApparentType2.ts, 0, 16)) function inner>() { >inner : Symbol(inner, Decl(typeArgumentInferenceApparentType2.ts, 0, 46)) >U : Symbol(U, Decl(typeArgumentInferenceApparentType2.ts, 1, 19)) ->Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Iterable : Symbol(Iterable, Decl(lib.es6.d.ts, --, --)) >T : Symbol(T, Decl(typeArgumentInferenceApparentType2.ts, 0, 16)) var u: U; diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index ef0c93f20cda5..ef02b0bb574c0 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -1,5 +1,4 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(25,35): error TS2345: Argument of type '3' is not assignable to parameter of type 'string'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(51,19): error TS2304: Cannot find name 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(61,39): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -10,15 +9,12 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct Types of parameters 'n' and 'b' are incompatible. Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(106,33): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(118,9): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(120,51): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(121,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,56): error TS2304: Cannot find name 'window'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(121,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts(122,74): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. -==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts (11 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts (7 errors) ==== // Generic call with no parameters interface NoParams { new (); @@ -72,8 +68,6 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct var someGenerics3: someGenerics3; new someGenerics3(() => ''); new someGenerics3(() => undefined); - ~~~~~~ -!!! error TS2304: Cannot find name 'Window'. new someGenerics3(() => 3); // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type @@ -155,18 +149,12 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct interface A92 { x: number; z?: Window; - ~~~~~~ -!!! error TS2304: Cannot find name 'Window'. } var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. var a9e: {}; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts 119:4, but here has type '{}'. var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. ~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. !!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.symbols b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.symbols index f251fb627535e..6acbb6225a587 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.symbols +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.symbols @@ -151,6 +151,7 @@ new someGenerics3(() => ''); new someGenerics3(() => undefined); >someGenerics3 : Symbol(someGenerics3, Decl(typeArgumentInferenceConstructSignatures.ts, 42, 62), Decl(typeArgumentInferenceConstructSignatures.ts, 48, 3)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) new someGenerics3(() => 3); @@ -405,6 +406,7 @@ interface A92 { z?: Window; >z : Symbol(A92.z, Decl(typeArgumentInferenceConstructSignatures.ts, 116, 14)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >a9e : Symbol(a9e, Decl(typeArgumentInferenceConstructSignatures.ts, 119, 3), Decl(typeArgumentInferenceConstructSignatures.ts, 120, 3)) @@ -412,6 +414,7 @@ var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >undefined : Symbol(undefined) >x : Symbol(x, Decl(typeArgumentInferenceConstructSignatures.ts, 119, 40)) >z : Symbol(z, Decl(typeArgumentInferenceConstructSignatures.ts, 119, 46)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeArgumentInferenceConstructSignatures.ts, 119, 61)) >y : Symbol(y, Decl(typeArgumentInferenceConstructSignatures.ts, 119, 67)) @@ -425,6 +428,7 @@ var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' } >undefined : Symbol(undefined) >x : Symbol(x, Decl(typeArgumentInferenceConstructSignatures.ts, 121, 45)) >z : Symbol(z, Decl(typeArgumentInferenceConstructSignatures.ts, 121, 51)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeArgumentInferenceConstructSignatures.ts, 121, 66)) >y : Symbol(y, Decl(typeArgumentInferenceConstructSignatures.ts, 121, 72)) diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types index 04dae1dafa758..125bd236b3701 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.types @@ -189,7 +189,7 @@ new someGenerics3(() => ''); new someGenerics3(() => undefined); >new someGenerics3(() => undefined) : any >someGenerics3 : someGenerics3 ->Window : No type information available! +>Window : Window >() => undefined : () => any >undefined : undefined @@ -520,19 +520,19 @@ interface A92 { >x : number z?: Window; ->z : any ->Window : No type information available! +>z : Window +>Window : Window } var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ->a9e : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } ->new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } +>a9e : { x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; } +>new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : { x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : someGenerics9 >undefined : undefined ->{ x: 6, z: window } : { x: number; z: any; } +>{ x: 6, z: window } : { x: number; z: Window; } >x : number >6 : 6 ->z : any ->window : any +>z : Window +>window : Window >{ x: 6, y: '' } : { x: number; y: string; } >x : number >6 : 6 @@ -540,7 +540,7 @@ var a9e = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >'' : "" var a9e: {}; ->a9e : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } +>a9e : { x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; } var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >a9f : any @@ -548,11 +548,11 @@ var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' } >someGenerics9 : someGenerics9 >A92 : A92 >undefined : undefined ->{ x: 6, z: window } : { x: number; z: any; } +>{ x: 6, z: window } : { x: number; z: Window; } >x : number >6 : 6 ->z : any ->window : any +>z : Window +>window : Window >{ x: 6, y: '' } : { x: number; y: string; } >x : number >6 : 6 diff --git a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.symbols b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.symbols index 79ab6f0e27609..f98237f556dd1 100644 --- a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.symbols +++ b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.symbols @@ -2,7 +2,7 @@ function fn(a: A, b: B, c: C) { >fn : Symbol(fn, Decl(typeArgumentInferenceTransitiveConstraints.ts, 0, 0)) >A : Symbol(A, Decl(typeArgumentInferenceTransitiveConstraints.ts, 0, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >B : Symbol(B, Decl(typeArgumentInferenceTransitiveConstraints.ts, 0, 27)) >A : Symbol(A, Decl(typeArgumentInferenceTransitiveConstraints.ts, 0, 12)) >C : Symbol(C, Decl(typeArgumentInferenceTransitiveConstraints.ts, 0, 40)) @@ -23,11 +23,11 @@ function fn(a: A, b: B, c: C) { var d = fn(new Date(), new Date(), new Date()); >d : Symbol(d, Decl(typeArgumentInferenceTransitiveConstraints.ts, 4, 3), Decl(typeArgumentInferenceTransitiveConstraints.ts, 5, 3)) >fn : Symbol(fn, Decl(typeArgumentInferenceTransitiveConstraints.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var d: Date[]; // Should be OK (d should be Date[]) >d : Symbol(d, Decl(typeArgumentInferenceTransitiveConstraints.ts, 4, 3), Decl(typeArgumentInferenceTransitiveConstraints.ts, 5, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 2b3053906896d..3713e8dd9837b 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -1,8 +1,9 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(11,17): error TS2344: Type '{}' does not satisfy the constraint 'number'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(16,23): error TS2344: Type 'number' does not satisfy the constraint 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(17,23): error TS2344: Type '{}' does not satisfy the constraint 'number'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(32,34): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(34,15): error TS2304: Cannot find name 'Window'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(33,15): error TS2345: Argument of type '() => string' is not assignable to parameter of type '() => Window'. + Type 'string' is not assignable to type 'Window'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(35,15): error TS2344: Type 'number' does not satisfy the constraint 'Window'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(41,35): error TS2345: Argument of type '(x: string) => string' is not assignable to parameter of type '(x: number) => void'. Types of parameters 'x' and 'x' are incompatible. Type 'number' is not assignable to type 'string'. @@ -15,15 +16,12 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst Type 'number' is not assignable to type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(66,31): error TS2345: Argument of type '(a: (a: A) => A, b: (b: B) => B, c: (c: C) => C) => void' is not assignable to parameter of type 'string'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(73,29): error TS2345: Argument of type '0' is not assignable to parameter of type '""'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(85,9): error TS2304: Cannot find name 'Window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(87,47): error TS2304: Cannot find name 'window'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(88,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. -tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,52): error TS2304: Cannot find name 'window'. +tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(88,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts(89,70): error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. Object literal may only specify known properties, and 'y' does not exist in type 'A92'. -==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts (16 errors) ==== +==== tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts (13 errors) ==== // Generic call with no parameters function noParams() { } noParams(); @@ -62,13 +60,14 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst // Generic call with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter function someGenerics3(producer: () => T) { } - ~~~~~~ -!!! error TS2304: Cannot find name 'Window'. someGenerics3(() => ''); // Error + ~~~~~~~~ +!!! error TS2345: Argument of type '() => string' is not assignable to parameter of type '() => Window'. +!!! error TS2345: Type 'string' is not assignable to type 'Window'. someGenerics3(() => undefined); - ~~~~~~ -!!! error TS2304: Cannot find name 'Window'. someGenerics3(() => 3); // Error + ~~~~~~ +!!! error TS2344: Type 'number' does not satisfy the constraint 'Window'. // 2 parameter generic call with argument 1 of type parameter type and argument 2 of function type whose parameter is of type parameter type function someGenerics4(n: T, f: (x: U) => void) { } @@ -137,18 +136,12 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst interface A92 { x: number; z?: Window; - ~~~~~~ -!!! error TS2304: Cannot find name 'Window'. } var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. var a9e: {}; ~~~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' has type '{ x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; }' at tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts 86:4, but here has type '{}'. var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); - ~~~~~~ -!!! error TS2304: Cannot find name 'window'. ~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. !!! error TS2345: Object literal may only specify known properties, and 'y' does not exist in type 'A92'. diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.symbols b/tests/baselines/reference/typeArgumentInferenceWithConstraints.symbols index 435dfe41e10d3..52789f14706a6 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.symbols +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.symbols @@ -111,6 +111,7 @@ someGenerics2b((n, t) => n.substr(t * t)); function someGenerics3(producer: () => T) { } >someGenerics3 : Symbol(someGenerics3, Decl(typeArgumentInferenceWithConstraints.ts, 28, 58)) >T : Symbol(T, Decl(typeArgumentInferenceWithConstraints.ts, 31, 23)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >producer : Symbol(producer, Decl(typeArgumentInferenceWithConstraints.ts, 31, 41)) >T : Symbol(T, Decl(typeArgumentInferenceWithConstraints.ts, 31, 23)) @@ -119,6 +120,7 @@ someGenerics3(() => ''); // Error someGenerics3(() => undefined); >someGenerics3 : Symbol(someGenerics3, Decl(typeArgumentInferenceWithConstraints.ts, 28, 58)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) someGenerics3(() => 3); // Error @@ -340,6 +342,7 @@ interface A92 { z?: Window; >z : Symbol(A92.z, Decl(typeArgumentInferenceWithConstraints.ts, 83, 14)) +>Window : Symbol(Window, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >a9e : Symbol(a9e, Decl(typeArgumentInferenceWithConstraints.ts, 86, 3), Decl(typeArgumentInferenceWithConstraints.ts, 87, 3)) @@ -347,6 +350,7 @@ var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >undefined : Symbol(undefined) >x : Symbol(x, Decl(typeArgumentInferenceWithConstraints.ts, 86, 36)) >z : Symbol(z, Decl(typeArgumentInferenceWithConstraints.ts, 86, 42)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeArgumentInferenceWithConstraints.ts, 86, 57)) >y : Symbol(y, Decl(typeArgumentInferenceWithConstraints.ts, 86, 63)) @@ -360,6 +364,7 @@ var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >undefined : Symbol(undefined) >x : Symbol(x, Decl(typeArgumentInferenceWithConstraints.ts, 88, 41)) >z : Symbol(z, Decl(typeArgumentInferenceWithConstraints.ts, 88, 47)) +>window : Symbol(window, Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeArgumentInferenceWithConstraints.ts, 88, 62)) >y : Symbol(y, Decl(typeArgumentInferenceWithConstraints.ts, 88, 68)) diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types index 4ca65f02b02b8..45510dd9f8d64 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.types +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.types @@ -146,28 +146,28 @@ someGenerics2b((n, t) => n.substr(t * t)); // Generic call with argument of function type whose parameter is not of type parameter type but body/return type uses type parameter function someGenerics3(producer: () => T) { } ->someGenerics3 : (producer: () => T) => void +>someGenerics3 : (producer: () => T) => void >T : T ->Window : No type information available! +>Window : Window >producer : () => T >T : T someGenerics3(() => ''); // Error ->someGenerics3(() => '') : void ->someGenerics3 : (producer: () => T) => void +>someGenerics3(() => '') : any +>someGenerics3 : (producer: () => T) => void >() => '' : () => string >'' : "" someGenerics3(() => undefined); >someGenerics3(() => undefined) : void ->someGenerics3 : (producer: () => T) => void ->Window : No type information available! +>someGenerics3 : (producer: () => T) => void +>Window : Window >() => undefined : () => any >undefined : undefined someGenerics3(() => 3); // Error ->someGenerics3(() => 3) : void ->someGenerics3 : (producer: () => T) => void +>someGenerics3(() => 3) : any +>someGenerics3 : (producer: () => T) => void >() => 3 : () => number >3 : 3 @@ -460,19 +460,19 @@ interface A92 { >x : number z?: Window; ->z : any ->Window : No type information available! +>z : Window +>Window : Window } var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ->a9e : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } ->someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } +>a9e : { x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; } +>someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }) : { x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; } >someGenerics9 : (a: T, b: T, c: T) => T >undefined : undefined ->{ x: 6, z: window } : { x: number; z: any; } +>{ x: 6, z: window } : { x: number; z: Window; } >x : number >6 : 6 ->z : any ->window : any +>z : Window +>window : Window >{ x: 6, y: '' } : { x: number; y: string; } >x : number >6 : 6 @@ -480,7 +480,7 @@ var a9e = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >'' : "" var a9e: {}; ->a9e : { x: number; z: any; y?: undefined; } | { x: number; y: string; z?: undefined; } +>a9e : { x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; } var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >a9f : any @@ -488,11 +488,11 @@ var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); >someGenerics9 : (a: T, b: T, c: T) => T >A92 : A92 >undefined : undefined ->{ x: 6, z: window } : { x: number; z: any; } +>{ x: 6, z: window } : { x: number; z: Window; } >x : number >6 : 6 ->z : any ->window : any +>z : Window +>window : Window >{ x: 6, y: '' } : { x: number; y: string; } >x : number >6 : 6 diff --git a/tests/baselines/reference/typeGuardsNestedAssignments.js b/tests/baselines/reference/typeGuardsNestedAssignments.js index 55778a49941a3..fad61ebec357d 100644 --- a/tests/baselines/reference/typeGuardsNestedAssignments.js +++ b/tests/baselines/reference/typeGuardsNestedAssignments.js @@ -81,5 +81,5 @@ function f4() { var re = /./g; var match; while ((match = re.exec("xxx")) != null) { - var length = match[1].length + match[2].length; + var length_1 = match[1].length + match[2].length; } diff --git a/tests/baselines/reference/typeInferenceLiteralUnion.symbols b/tests/baselines/reference/typeInferenceLiteralUnion.symbols index 51fc4c828ec1a..011dea66f244d 100644 --- a/tests/baselines/reference/typeInferenceLiteralUnion.symbols +++ b/tests/baselines/reference/typeInferenceLiteralUnion.symbols @@ -5,7 +5,7 @@ */ export type Primitive = number | string | boolean | Date; >Primitive : Symbol(Primitive, Decl(typeInferenceLiteralUnion.ts, 0, 0)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) /** * Administrivia: anything with a valueOf(): number method is comparable, so we allow it in numeric operations diff --git a/tests/baselines/reference/typeOfThisInMemberFunctions.symbols b/tests/baselines/reference/typeOfThisInMemberFunctions.symbols index a98234023c596..c2c90ef343467 100644 --- a/tests/baselines/reference/typeOfThisInMemberFunctions.symbols +++ b/tests/baselines/reference/typeOfThisInMemberFunctions.symbols @@ -47,7 +47,7 @@ class D { class E { >E : Symbol(E, Decl(typeOfThisInMemberFunctions.ts, 19, 1)) >T : Symbol(T, Decl(typeOfThisInMemberFunctions.ts, 21, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) x: T; >x : Symbol(E.x, Decl(typeOfThisInMemberFunctions.ts, 21, 25)) diff --git a/tests/baselines/reference/typeParameterAssignability2.symbols b/tests/baselines/reference/typeParameterAssignability2.symbols index 6650db938f042..0bf94533ddec7 100644 --- a/tests/baselines/reference/typeParameterAssignability2.symbols +++ b/tests/baselines/reference/typeParameterAssignability2.symbols @@ -85,7 +85,7 @@ function foo4(t: T, u: U, v: V) { >U : Symbol(U, Decl(typeParameterAssignability2.ts, 23, 26)) >V : Symbol(V, Decl(typeParameterAssignability2.ts, 23, 39)) >V : Symbol(V, Decl(typeParameterAssignability2.ts, 23, 39)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >t : Symbol(t, Decl(typeParameterAssignability2.ts, 23, 56)) >T : Symbol(T, Decl(typeParameterAssignability2.ts, 23, 14)) >u : Symbol(u, Decl(typeParameterAssignability2.ts, 23, 61)) @@ -103,7 +103,7 @@ function foo4(t: T, u: U, v: V) { t = new Date(); // error >t : Symbol(t, Decl(typeParameterAssignability2.ts, 23, 56)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) u = t; >u : Symbol(u, Decl(typeParameterAssignability2.ts, 23, 61)) @@ -115,7 +115,7 @@ function foo4(t: T, u: U, v: V) { u = new Date(); // error >u : Symbol(u, Decl(typeParameterAssignability2.ts, 23, 61)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) v = t; >v : Symbol(v, Decl(typeParameterAssignability2.ts, 23, 67)) @@ -127,11 +127,11 @@ function foo4(t: T, u: U, v: V) { v = new Date(); // ok >v : Symbol(v, Decl(typeParameterAssignability2.ts, 23, 67)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var d: Date; >d : Symbol(d, Decl(typeParameterAssignability2.ts, 36, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) d = t; // ok >d : Symbol(d, Decl(typeParameterAssignability2.ts, 36, 7)) @@ -150,7 +150,7 @@ function foo4(t: T, u: U, v: V) { function foo5(t: T, u: U, v: V) { >foo5 : Symbol(foo5, Decl(typeParameterAssignability2.ts, 40, 1)) >V : Symbol(V, Decl(typeParameterAssignability2.ts, 43, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(typeParameterAssignability2.ts, 43, 29)) >V : Symbol(V, Decl(typeParameterAssignability2.ts, 43, 14)) >T : Symbol(T, Decl(typeParameterAssignability2.ts, 43, 42)) @@ -172,7 +172,7 @@ function foo5(t: T, u: U, v: V) { t = new Date(); // error >t : Symbol(t, Decl(typeParameterAssignability2.ts, 43, 56)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) u = t; >u : Symbol(u, Decl(typeParameterAssignability2.ts, 43, 61)) @@ -184,7 +184,7 @@ function foo5(t: T, u: U, v: V) { u = new Date(); // error >u : Symbol(u, Decl(typeParameterAssignability2.ts, 43, 61)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) v = t; >v : Symbol(v, Decl(typeParameterAssignability2.ts, 43, 67)) @@ -196,11 +196,11 @@ function foo5(t: T, u: U, v: V) { v = new Date(); // ok >v : Symbol(v, Decl(typeParameterAssignability2.ts, 43, 67)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var d: Date; >d : Symbol(d, Decl(typeParameterAssignability2.ts, 56, 7)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) d = t; // ok >d : Symbol(d, Decl(typeParameterAssignability2.ts, 56, 7)) diff --git a/tests/baselines/reference/typeParameterConstraints1.symbols b/tests/baselines/reference/typeParameterConstraints1.symbols index 32595208b8a14..5d72413944234 100644 --- a/tests/baselines/reference/typeParameterConstraints1.symbols +++ b/tests/baselines/reference/typeParameterConstraints1.symbols @@ -20,7 +20,7 @@ function foo3(test: T) { } function foo4(test: T) { } // valid >foo4 : Symbol(foo4, Decl(typeParameterConstraints1.ts, 2, 44)) >T : Symbol(T, Decl(typeParameterConstraints1.ts, 3, 14)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >test : Symbol(test, Decl(typeParameterConstraints1.ts, 3, 30)) >T : Symbol(T, Decl(typeParameterConstraints1.ts, 3, 14)) diff --git a/tests/baselines/reference/typeParameterUsedAsConstraint.symbols b/tests/baselines/reference/typeParameterUsedAsConstraint.symbols index 2ab34915a65f1..17a1d454e50f4 100644 --- a/tests/baselines/reference/typeParameterUsedAsConstraint.symbols +++ b/tests/baselines/reference/typeParameterUsedAsConstraint.symbols @@ -14,7 +14,7 @@ class C2 { } class C3 { } >C3 : Symbol(C3, Decl(typeParameterUsedAsConstraint.ts, 1, 28)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 2, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 2, 24)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 2, 9)) @@ -23,7 +23,7 @@ class C4 { } >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 3, 9)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 3, 21)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 3, 21)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) class C5 { } >C5 : Symbol(C5, Decl(typeParameterUsedAsConstraint.ts, 3, 41)) @@ -56,7 +56,7 @@ interface I2 { } interface I3 { } >I3 : Symbol(I3, Decl(typeParameterUsedAsConstraint.ts, 8, 32)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 9, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 9, 28)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 9, 13)) @@ -65,7 +65,7 @@ interface I4 { } >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 10, 13)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 10, 25)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 10, 25)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) interface I5 { } >I5 : Symbol(I5, Decl(typeParameterUsedAsConstraint.ts, 10, 45)) @@ -98,7 +98,7 @@ function f2() { } function f3() { } >f3 : Symbol(f3, Decl(typeParameterUsedAsConstraint.ts, 15, 33)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 16, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 16, 27)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 16, 12)) @@ -107,7 +107,7 @@ function f4() { } >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 17, 12)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 17, 24)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 17, 24)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) function f5() { } >f5 : Symbol(f5, Decl(typeParameterUsedAsConstraint.ts, 17, 46)) @@ -140,7 +140,7 @@ var e2 = () => { } var e3 = () => { } >e3 : Symbol(e3, Decl(typeParameterUsedAsConstraint.ts, 23, 3)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 23, 10)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 23, 25)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 23, 10)) @@ -149,7 +149,7 @@ var e4 = () => { } >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 24, 10)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 24, 22)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 24, 22)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var e5 = () => { } >e5 : Symbol(e5, Decl(typeParameterUsedAsConstraint.ts, 25, 3)) @@ -182,7 +182,7 @@ var a2: { (): void } var a3: { (): void } >a3 : Symbol(a3, Decl(typeParameterUsedAsConstraint.ts, 30, 3)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 30, 11)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 30, 26)) >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 30, 11)) @@ -191,7 +191,7 @@ var a4: { (): void } >T : Symbol(T, Decl(typeParameterUsedAsConstraint.ts, 31, 11)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 31, 23)) >U : Symbol(U, Decl(typeParameterUsedAsConstraint.ts, 31, 23)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var a5: { (): void } >a5 : Symbol(a5, Decl(typeParameterUsedAsConstraint.ts, 32, 3)) diff --git a/tests/baselines/reference/typeParametersAreIdenticalToThemselves.symbols b/tests/baselines/reference/typeParametersAreIdenticalToThemselves.symbols index 39479bdba90e0..23eb6ed8c5f4b 100644 --- a/tests/baselines/reference/typeParametersAreIdenticalToThemselves.symbols +++ b/tests/baselines/reference/typeParametersAreIdenticalToThemselves.symbols @@ -144,21 +144,21 @@ class C { foo4(x: T); >foo4 : Symbol(C.foo4, Decl(typeParametersAreIdenticalToThemselves.ts, 31, 21), Decl(typeParametersAreIdenticalToThemselves.ts, 33, 31), Decl(typeParametersAreIdenticalToThemselves.ts, 34, 31)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 33, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeParametersAreIdenticalToThemselves.ts, 33, 25)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 33, 9)) foo4(x: T); // no error, different declaration for each T >foo4 : Symbol(C.foo4, Decl(typeParametersAreIdenticalToThemselves.ts, 31, 21), Decl(typeParametersAreIdenticalToThemselves.ts, 33, 31), Decl(typeParametersAreIdenticalToThemselves.ts, 34, 31)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 34, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeParametersAreIdenticalToThemselves.ts, 34, 25)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 34, 9)) foo4(x: T) { } >foo4 : Symbol(C.foo4, Decl(typeParametersAreIdenticalToThemselves.ts, 31, 21), Decl(typeParametersAreIdenticalToThemselves.ts, 33, 31), Decl(typeParametersAreIdenticalToThemselves.ts, 34, 31)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 35, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeParametersAreIdenticalToThemselves.ts, 35, 25)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 35, 9)) } @@ -166,7 +166,7 @@ class C { class C2 { >C2 : Symbol(C2, Decl(typeParametersAreIdenticalToThemselves.ts, 36, 1)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 38, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo1(x: T); >foo1 : Symbol(C2.foo1, Decl(typeParametersAreIdenticalToThemselves.ts, 38, 26), Decl(typeParametersAreIdenticalToThemselves.ts, 39, 15), Decl(typeParametersAreIdenticalToThemselves.ts, 40, 15)) @@ -271,14 +271,14 @@ interface I { foo4(x: T); >foo4 : Symbol(I.foo4, Decl(typeParametersAreIdenticalToThemselves.ts, 60, 18), Decl(typeParametersAreIdenticalToThemselves.ts, 62, 31)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 62, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeParametersAreIdenticalToThemselves.ts, 62, 25)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 62, 9)) foo4(x: T); // no error, different declaration for each T >foo4 : Symbol(I.foo4, Decl(typeParametersAreIdenticalToThemselves.ts, 60, 18), Decl(typeParametersAreIdenticalToThemselves.ts, 62, 31)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 63, 9)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(typeParametersAreIdenticalToThemselves.ts, 63, 25)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 63, 9)) } @@ -286,7 +286,7 @@ interface I { interface I2 { >I2 : Symbol(I2, Decl(typeParametersAreIdenticalToThemselves.ts, 64, 1)) >T : Symbol(T, Decl(typeParametersAreIdenticalToThemselves.ts, 66, 13)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo1(x: T); >foo1 : Symbol(I2.foo1, Decl(typeParametersAreIdenticalToThemselves.ts, 66, 30), Decl(typeParametersAreIdenticalToThemselves.ts, 67, 15)) diff --git a/tests/baselines/reference/typeParametersShouldNotBeEqual2.symbols b/tests/baselines/reference/typeParametersShouldNotBeEqual2.symbols index e281f70934141..b87249e2a5d86 100644 --- a/tests/baselines/reference/typeParametersShouldNotBeEqual2.symbols +++ b/tests/baselines/reference/typeParametersShouldNotBeEqual2.symbols @@ -2,9 +2,9 @@ function ff(x: T, y: U, z: V) { >ff : Symbol(ff, Decl(typeParametersShouldNotBeEqual2.ts, 0, 0)) >T : Symbol(T, Decl(typeParametersShouldNotBeEqual2.ts, 0, 12)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >U : Symbol(U, Decl(typeParametersShouldNotBeEqual2.ts, 0, 27)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >V : Symbol(V, Decl(typeParametersShouldNotBeEqual2.ts, 0, 43)) >x : Symbol(x, Decl(typeParametersShouldNotBeEqual2.ts, 0, 47)) >T : Symbol(T, Decl(typeParametersShouldNotBeEqual2.ts, 0, 12)) diff --git a/tests/baselines/reference/typedArrays.symbols b/tests/baselines/reference/typedArrays.symbols index 1080fa39e8959..7bc6cecf543e8 100644 --- a/tests/baselines/reference/typedArrays.symbols +++ b/tests/baselines/reference/typedArrays.symbols @@ -7,39 +7,39 @@ function CreateTypedArrayTypes() { typedArrays[0] = Int8Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) typedArrays[1] = Uint8Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) typedArrays[2] = Int16Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) typedArrays[3] = Uint16Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) typedArrays[4] = Int32Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) typedArrays[5] = Uint32Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) typedArrays[6] = Float32Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) typedArrays[7] = Float64Array; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) typedArrays[8] = Uint8ClampedArray; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) return typedArrays; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 1, 7)) @@ -54,47 +54,47 @@ function CreateTypedArrayInstancesFromLength(obj: number) { typedArrays[0] = new Int8Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) typedArrays[1] = new Uint8Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) typedArrays[2] = new Int16Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) typedArrays[3] = new Uint16Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) typedArrays[4] = new Int32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) typedArrays[5] = new Uint32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) typedArrays[6] = new Float32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) typedArrays[7] = new Float64Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) typedArrays[8] = new Uint8ClampedArray(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 16, 7)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 15, 45)) return typedArrays; @@ -110,47 +110,47 @@ function CreateTypedArrayInstancesFromArray(obj: number[]) { typedArrays[0] = new Int8Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) typedArrays[1] = new Uint8Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) typedArrays[2] = new Int16Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) typedArrays[3] = new Uint16Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) typedArrays[4] = new Int32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) typedArrays[5] = new Uint32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) typedArrays[6] = new Float32Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) typedArrays[7] = new Float64Array(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) typedArrays[8] = new Uint8ClampedArray(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 31, 7)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 30, 44)) return typedArrays; @@ -166,65 +166,65 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { typedArrays[0] = Int8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[1] = Uint8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[2] = Int16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[3] = Uint16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[4] = Int32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[5] = Uint32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[6] = Float32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[7] = Float64Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) typedArrays[8] = Uint8ClampedArray.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 46, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 45, 44)) return typedArrays; @@ -234,72 +234,72 @@ function CreateIntegerTypedArraysFromArray2(obj:number[]) { function CreateIntegerTypedArraysFromArrayLike(obj:ArrayLike) { >CreateIntegerTypedArraysFromArrayLike : Symbol(CreateIntegerTypedArraysFromArrayLike, Decl(typedArrays.ts, 58, 1)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) ->ArrayLike : Symbol(ArrayLike, Decl(lib.es5.d.ts, --, --)) +>ArrayLike : Symbol(ArrayLike, Decl(lib.es6.d.ts, --, --)) var typedArrays = []; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) typedArrays[0] = Int8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[1] = Uint8Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[2] = Int16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[3] = Uint16Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[4] = Int32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[5] = Uint32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[6] = Float32Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[7] = Float64Array.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) typedArrays[8] = Uint8ClampedArray.from(obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 61, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 60, 47)) return typedArrays; @@ -315,65 +315,65 @@ function CreateTypedArraysOf(obj) { typedArrays[0] = Int8Array.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Int8ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Int8ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) typedArrays[1] = Uint8Array.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Uint8ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Uint8ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) typedArrays[2] = Int16Array.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Int16ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Int16ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) typedArrays[3] = Uint16Array.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Uint16ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Uint16ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) typedArrays[4] = Int32Array.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Int32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Int32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) typedArrays[5] = Uint32Array.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Uint32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Uint32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) typedArrays[6] = Float32Array.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Float32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Float32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) typedArrays[7] = Float64Array.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Float64ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Float64ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) typedArrays[8] = Uint8ClampedArray.of(...obj); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 76, 7)) ->Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 75, 29)) return typedArrays; @@ -388,57 +388,57 @@ function CreateTypedArraysOf2() { typedArrays[0] = Int8Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Int8ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Int8Array.of : Symbol(Int8ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Int8ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) typedArrays[1] = Uint8Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Uint8ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Uint8Array.of : Symbol(Uint8ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Uint8ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) typedArrays[2] = Int16Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Int16ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Int16Array.of : Symbol(Int16ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Int16ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) typedArrays[3] = Uint16Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Uint16ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Uint16Array.of : Symbol(Uint16ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Uint16ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) typedArrays[4] = Int32Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Int32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Int32Array.of : Symbol(Int32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Int32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) typedArrays[5] = Uint32Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Uint32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Uint32Array.of : Symbol(Uint32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Uint32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) typedArrays[6] = Float32Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Float32ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Float32Array.of : Symbol(Float32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Float32ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) typedArrays[7] = Float64Array.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Float64ArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Float64Array.of : Symbol(Float64ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Float64ArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) typedArrays[8] = Uint8ClampedArray.of(1,2,3,4); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) ->Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.es5.d.ts, --, --)) +>Uint8ClampedArray.of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>of : Symbol(Uint8ClampedArrayConstructor.of, Decl(lib.es6.d.ts, --, --)) return typedArrays; >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 91, 7)) @@ -447,7 +447,7 @@ function CreateTypedArraysOf2() { function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:number)=> number) { >CreateTypedArraysFromMapFn : Symbol(CreateTypedArraysFromMapFn, Decl(typedArrays.ts, 103, 1)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) ->ArrayLike : Symbol(ArrayLike, Decl(lib.es5.d.ts, --, --)) +>ArrayLike : Symbol(ArrayLike, Decl(lib.es6.d.ts, --, --)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) >n : Symbol(n, Decl(typedArrays.ts, 105, 67)) >v : Symbol(v, Decl(typedArrays.ts, 105, 76)) @@ -457,73 +457,73 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n typedArrays[0] = Int8Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) typedArrays[1] = Uint8Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) typedArrays[2] = Int16Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) typedArrays[3] = Uint16Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) typedArrays[4] = Int32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) typedArrays[5] = Uint32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) typedArrays[6] = Float32Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) typedArrays[7] = Float64Array.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 106, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 105, 36)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 105, 58)) @@ -534,7 +534,7 @@ function CreateTypedArraysFromMapFn(obj:ArrayLike, mapFn: (n:number, v:n function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v:number)=> number, thisArg: {}) { >CreateTypedArraysFromThisObj : Symbol(CreateTypedArraysFromThisObj, Decl(typedArrays.ts, 118, 1)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) ->ArrayLike : Symbol(ArrayLike, Decl(lib.es5.d.ts, --, --)) +>ArrayLike : Symbol(ArrayLike, Decl(lib.es6.d.ts, --, --)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >n : Symbol(n, Decl(typedArrays.ts, 120, 69)) >v : Symbol(v, Decl(typedArrays.ts, 120, 78)) @@ -545,81 +545,81 @@ function CreateTypedArraysFromThisObj(obj:ArrayLike, mapFn: (n:number, v typedArrays[0] = Int8Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array.from : Symbol(Int8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) typedArrays[1] = Uint8Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array.from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint8ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) typedArrays[2] = Int16Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array.from : Symbol(Int16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) typedArrays[3] = Uint16Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array.from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint16ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) typedArrays[4] = Int32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Int32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array.from : Symbol(Int32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Int32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) typedArrays[5] = Uint32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array.from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) typedArrays[6] = Float32Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Float32ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array.from : Symbol(Float32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Float32ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) typedArrays[7] = Float64Array.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Float64ArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array.from : Symbol(Float64ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Float64ArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) typedArrays[8] = Uint8ClampedArray.from(obj, mapFn, thisArg); >typedArrays : Symbol(typedArrays, Decl(typedArrays.ts, 121, 7)) ->Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) ->from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray.from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) +>from : Symbol(Uint8ClampedArrayConstructor.from, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >obj : Symbol(obj, Decl(typedArrays.ts, 120, 38)) >mapFn : Symbol(mapFn, Decl(typedArrays.ts, 120, 60)) >thisArg : Symbol(thisArg, Decl(typedArrays.ts, 120, 98)) diff --git a/tests/baselines/reference/typedArraysCrossAssignability01.symbols b/tests/baselines/reference/typedArraysCrossAssignability01.symbols index f3d2a8828115c..be3070df6ef36 100644 --- a/tests/baselines/reference/typedArraysCrossAssignability01.symbols +++ b/tests/baselines/reference/typedArraysCrossAssignability01.symbols @@ -4,39 +4,39 @@ function CheckAssignability() { let arr_Int8Array = new Int8Array(1); >arr_Int8Array : Symbol(arr_Int8Array, Decl(typedArraysCrossAssignability01.ts, 1, 7)) ->Int8Array : Symbol(Int8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int8Array : Symbol(Int8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let arr_Uint8Array = new Uint8Array(1); >arr_Uint8Array : Symbol(arr_Uint8Array, Decl(typedArraysCrossAssignability01.ts, 2, 7)) ->Uint8Array : Symbol(Uint8Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8Array : Symbol(Uint8Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let arr_Int16Array = new Int16Array(1); >arr_Int16Array : Symbol(arr_Int16Array, Decl(typedArraysCrossAssignability01.ts, 3, 7)) ->Int16Array : Symbol(Int16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int16Array : Symbol(Int16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let arr_Uint16Array = new Uint16Array(1); >arr_Uint16Array : Symbol(arr_Uint16Array, Decl(typedArraysCrossAssignability01.ts, 4, 7)) ->Uint16Array : Symbol(Uint16Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint16Array : Symbol(Uint16Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let arr_Int32Array = new Int32Array(1); >arr_Int32Array : Symbol(arr_Int32Array, Decl(typedArraysCrossAssignability01.ts, 5, 7)) ->Int32Array : Symbol(Int32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Int32Array : Symbol(Int32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let arr_Uint32Array = new Uint32Array(1); >arr_Uint32Array : Symbol(arr_Uint32Array, Decl(typedArraysCrossAssignability01.ts, 6, 7)) ->Uint32Array : Symbol(Uint32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint32Array : Symbol(Uint32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let arr_Float32Array = new Float32Array(1); >arr_Float32Array : Symbol(arr_Float32Array, Decl(typedArraysCrossAssignability01.ts, 7, 7)) ->Float32Array : Symbol(Float32Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float32Array : Symbol(Float32Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let arr_Float64Array = new Float64Array(1); >arr_Float64Array : Symbol(arr_Float64Array, Decl(typedArraysCrossAssignability01.ts, 8, 7)) ->Float64Array : Symbol(Float64Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Float64Array : Symbol(Float64Array, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) let arr_Uint8ClampedArray = new Uint8ClampedArray(1); >arr_Uint8ClampedArray : Symbol(arr_Uint8ClampedArray, Decl(typedArraysCrossAssignability01.ts, 9, 7)) ->Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --)) +>Uint8ClampedArray : Symbol(Uint8ClampedArray, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) arr_Int8Array = arr_Int8Array; >arr_Int8Array : Symbol(arr_Int8Array, Decl(typedArraysCrossAssignability01.ts, 1, 7)) diff --git a/tests/baselines/reference/undefinedAssignableToEveryType.symbols b/tests/baselines/reference/undefinedAssignableToEveryType.symbols index c48839ea50fa2..18f568da52e7d 100644 --- a/tests/baselines/reference/undefinedAssignableToEveryType.symbols +++ b/tests/baselines/reference/undefinedAssignableToEveryType.symbols @@ -41,7 +41,7 @@ var d: boolean = undefined; var e: Date = undefined; >e : Symbol(e, Decl(undefinedAssignableToEveryType.ts, 15, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >undefined : Symbol(undefined) var f: any = undefined; @@ -119,7 +119,7 @@ function foo(x: T, y: U, z: V) { >T : Symbol(T, Decl(undefinedAssignableToEveryType.ts, 32, 13)) >U : Symbol(U, Decl(undefinedAssignableToEveryType.ts, 32, 15)) >V : Symbol(V, Decl(undefinedAssignableToEveryType.ts, 32, 18)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(undefinedAssignableToEveryType.ts, 32, 35)) >T : Symbol(T, Decl(undefinedAssignableToEveryType.ts, 32, 13)) >y : Symbol(y, Decl(undefinedAssignableToEveryType.ts, 32, 40)) diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.symbols b/tests/baselines/reference/undefinedIsSubtypeOfEverything.symbols index f2776039d3aeb..0d0c6917dc25b 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.symbols +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.symbols @@ -95,7 +95,7 @@ class D5 extends Base { foo: Date; >foo : Symbol(D5.foo, Decl(undefinedIsSubtypeOfEverything.ts, 45, 23)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) } diff --git a/tests/baselines/reference/underscoreTest1.symbols b/tests/baselines/reference/underscoreTest1.symbols index 41b0c8110275a..e9b267124b058 100644 --- a/tests/baselines/reference/underscoreTest1.symbols +++ b/tests/baselines/reference/underscoreTest1.symbols @@ -5,7 +5,7 @@ declare var $; >$ : Symbol($, Decl(underscoreTest1_underscoreTests.ts, 2, 11)) declare function alert(x: string): void; ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) >x : Symbol(x, Decl(underscoreTest1_underscoreTests.ts, 3, 23)) _.each([1, 2, 3], (num) => alert(num.toString())); @@ -13,7 +13,7 @@ _.each([1, 2, 3], (num) => alert(num.toString())); >_ : Symbol(_, Decl(underscoreTest1_underscore.ts, 645, 11)) >each : Symbol(Underscore.Static.each, Decl(underscoreTest1_underscore.ts, 395, 43), Decl(underscoreTest1_underscore.ts, 397, 78)) >num : Symbol(num, Decl(underscoreTest1_underscoreTests.ts, 5, 19)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) >num.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) >num : Symbol(num, Decl(underscoreTest1_underscoreTests.ts, 5, 19)) >toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) @@ -27,7 +27,7 @@ _.each({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => alert(valu >three : Symbol(three, Decl(underscoreTest1_underscoreTests.ts, 6, 24)) >value : Symbol(value, Decl(underscoreTest1_underscoreTests.ts, 6, 38)) >key : Symbol(key, Decl(underscoreTest1_underscoreTests.ts, 6, 52)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) >value.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) >value : Symbol(value, Decl(underscoreTest1_underscoreTests.ts, 6, 38)) >toString : Symbol(Number.toString, Decl(lib.d.ts, --, --)) @@ -394,11 +394,11 @@ var buttonView = { onClick: function () { alert('clicked: ' + this.label); }, >onClick : Symbol(onClick, Decl(underscoreTest1_underscoreTests.ts, 97, 24)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) onHover: function () { alert('hovering: ' + this.label); } >onHover : Symbol(onHover, Decl(underscoreTest1_underscoreTests.ts, 98, 62)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) }; _.bindAll(buttonView); @@ -437,7 +437,7 @@ var log = _.bind((message?: string, ...rest: string[]) => { }, Date); >bind : Symbol(Underscore.Static.bind, Decl(underscoreTest1_underscore.ts, 548, 68), Decl(underscoreTest1_underscore.ts, 550, 58)) >message : Symbol(message, Decl(underscoreTest1_underscoreTests.ts, 108, 18)) >rest : Symbol(rest, Decl(underscoreTest1_underscoreTests.ts, 108, 35)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) _.delay(log, 1000, 'logged later'); >_.delay : Symbol(Underscore.Static.delay, Decl(underscoreTest1_underscore.ts, 557, 73)) @@ -449,11 +449,11 @@ _.defer(function () { alert('deferred'); }); >_.defer : Symbol(Underscore.Static.defer, Decl(underscoreTest1_underscore.ts, 559, 68)) >_ : Symbol(_, Decl(underscoreTest1_underscore.ts, 645, 11)) >defer : Symbol(Underscore.Static.defer, Decl(underscoreTest1_underscore.ts, 559, 68)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) var updatePosition = () => alert('updating position...'); >updatePosition : Symbol(updatePosition, Decl(underscoreTest1_underscoreTests.ts, 113, 3)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) var throttled = _.throttle(updatePosition, 100); >throttled : Symbol(throttled, Decl(underscoreTest1_underscoreTests.ts, 114, 3)) @@ -468,7 +468,7 @@ $(null).scroll(throttled); var calculateLayout = () => alert('calculating layout...'); >calculateLayout : Symbol(calculateLayout, Decl(underscoreTest1_underscoreTests.ts, 117, 3)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) var lazyLayout = _.debounce(calculateLayout, 300); >lazyLayout : Symbol(lazyLayout, Decl(underscoreTest1_underscoreTests.ts, 118, 3)) @@ -483,7 +483,7 @@ $(null).resize(lazyLayout); var createApplication = () => alert('creating application...'); >createApplication : Symbol(createApplication, Decl(underscoreTest1_underscoreTests.ts, 121, 3)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) var initialize = _.once(createApplication); >initialize : Symbol(initialize, Decl(underscoreTest1_underscoreTests.ts, 122, 3)) @@ -503,7 +503,7 @@ var notes: any[]; var render = () => alert("rendering..."); >render : Symbol(render, Decl(underscoreTest1_underscoreTests.ts, 127, 3)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) var renderNotes = _.after(notes.length, render); >renderNotes : Symbol(renderNotes, Decl(underscoreTest1_underscoreTests.ts, 128, 3)) @@ -662,7 +662,7 @@ _.chain([1, 2, 3, 200]) .tap(alert) >tap : Symbol(Underscore.ChainedArray.tap, Decl(underscoreTest1_underscore.ts, 325, 33)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) .map(function (num) { return num * num }) >map : Symbol(Underscore.ChainedArray.map, Decl(underscoreTest1_underscore.ts, 240, 82)) @@ -750,7 +750,7 @@ _.isFunction(alert); >_.isFunction : Symbol(Underscore.Static.isFunction, Decl(underscoreTest1_underscore.ts, 606, 42)) >_ : Symbol(_, Decl(underscoreTest1_underscore.ts, 645, 11)) >isFunction : Symbol(Underscore.Static.isFunction, Decl(underscoreTest1_underscore.ts, 606, 42)) ->alert : Symbol(alert, Decl(underscoreTest1_underscoreTests.ts, 2, 14)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --), Decl(underscoreTest1_underscoreTests.ts, 2, 14)) _.isString("moe"); >_.isString : Symbol(Underscore.Static.isString, Decl(underscoreTest1_underscore.ts, 607, 41)) @@ -782,7 +782,7 @@ _.isDate(new Date()); >_.isDate : Symbol(Underscore.Static.isDate, Decl(underscoreTest1_underscore.ts, 611, 40)) >_ : Symbol(_, Decl(underscoreTest1_underscore.ts, 645, 11)) >isDate : Symbol(Underscore.Static.isDate, Decl(underscoreTest1_underscore.ts, 611, 40)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) _.isRegExp(/moe/); >_.isRegExp : Symbol(Underscore.Static.isRegExp, Decl(underscoreTest1_underscore.ts, 612, 37)) diff --git a/tests/baselines/reference/underscoreTest1.types b/tests/baselines/reference/underscoreTest1.types index 4ab097e3316c9..b528f45d48420 100644 --- a/tests/baselines/reference/underscoreTest1.types +++ b/tests/baselines/reference/underscoreTest1.types @@ -5,7 +5,7 @@ declare var $; >$ : any declare function alert(x: string): void; ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >x : string _.each([1, 2, 3], (num) => alert(num.toString())); @@ -20,7 +20,7 @@ _.each([1, 2, 3], (num) => alert(num.toString())); >(num) => alert(num.toString()) : (num: number) => void >num : number >alert(num.toString()) : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >num.toString() : string >num.toString : (radix?: number) => string >num : number @@ -42,7 +42,7 @@ _.each({ one: 1, two: 2, three: 3 }, (value: number, key?: string) => alert(valu >value : number >key : string >alert(value.toString()) : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >value.toString() : string >value.toString : (radix?: number) => string >value : number @@ -824,7 +824,7 @@ var buttonView = { >onClick : () => void >function () { alert('clicked: ' + this.label); } : () => void >alert('clicked: ' + this.label) : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >'clicked: ' + this.label : string >'clicked: ' : "clicked: " >this.label : any @@ -835,7 +835,7 @@ var buttonView = { >onHover : () => void >function () { alert('hovering: ' + this.label); } : () => void >alert('hovering: ' + this.label) : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >'hovering: ' + this.label : string >'hovering: ' : "hovering: " >this.label : any @@ -918,14 +918,14 @@ _.defer(function () { alert('deferred'); }); >defer : (func: Function, ...args: any[]) => number >function () { alert('deferred'); } : () => void >alert('deferred') : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >'deferred' : "deferred" var updatePosition = () => alert('updating position...'); >updatePosition : () => void >() => alert('updating position...') : () => void >alert('updating position...') : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >'updating position...' : "updating position..." var throttled = _.throttle(updatePosition, 100); @@ -950,7 +950,7 @@ var calculateLayout = () => alert('calculating layout...'); >calculateLayout : () => void >() => alert('calculating layout...') : () => void >alert('calculating layout...') : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >'calculating layout...' : "calculating layout..." var lazyLayout = _.debounce(calculateLayout, 300); @@ -975,7 +975,7 @@ var createApplication = () => alert('creating application...'); >createApplication : () => void >() => alert('creating application...') : () => void >alert('creating application...') : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >'creating application...' : "creating application..." var initialize = _.once(createApplication); @@ -1001,7 +1001,7 @@ var render = () => alert("rendering..."); >render : () => void >() => alert("rendering...") : () => void >alert("rendering...") : void ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } >"rendering..." : "rendering..." var renderNotes = _.after(notes.length, render); @@ -1254,7 +1254,7 @@ _.chain([1, 2, 3, 200]) .tap(alert) >tap : (interceptor: (object: number[]) => void) => Underscore.ChainedArray >alert : any ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } .map(function (num) { return num * num }) >map : (iterator: Iterator_, context?: any) => Underscore.ChainedArray @@ -1395,7 +1395,7 @@ _.isFunction(alert); >_.isFunction : (object: any) => boolean >_ : Underscore.Static >isFunction : (object: any) => boolean ->alert : (x: string) => void +>alert : { (message?: any): void; (x: string): void; } _.isString("moe"); >_.isString("moe") : boolean diff --git a/tests/baselines/reference/unicodeIdentifierName2.errors.txt b/tests/baselines/reference/unicodeIdentifierName2.errors.txt index 2eabbee8db16f..d59b5c2b21a03 100644 --- a/tests/baselines/reference/unicodeIdentifierName2.errors.txt +++ b/tests/baselines/reference/unicodeIdentifierName2.errors.txt @@ -1,11 +1,10 @@ tests/cases/compiler/unicodeIdentifierName2.ts(1,6): error TS1127: Invalid character. tests/cases/compiler/unicodeIdentifierName2.ts(1,8): error TS1134: Variable declaration expected. tests/cases/compiler/unicodeIdentifierName2.ts(1,10): error TS1134: Variable declaration expected. -tests/cases/compiler/unicodeIdentifierName2.ts(1,19): error TS2304: Cannot find name 'alert'. tests/cases/compiler/unicodeIdentifierName2.ts(1,26): error TS1127: Invalid character. -==== tests/cases/compiler/unicodeIdentifierName2.ts (5 errors) ==== +==== tests/cases/compiler/unicodeIdentifierName2.ts (4 errors) ==== var a₁ = "hello"; alert(a₁) !!! error TS1127: Invalid character. @@ -13,7 +12,5 @@ tests/cases/compiler/unicodeIdentifierName2.ts(1,26): error TS1127: Invalid char !!! error TS1134: Variable declaration expected. ~~~~~~~ !!! error TS1134: Variable declaration expected. - ~~~~~ -!!! error TS2304: Cannot find name 'alert'. !!! error TS1127: Invalid character. \ No newline at end of file diff --git a/tests/baselines/reference/unicodeIdentifierName2.symbols b/tests/baselines/reference/unicodeIdentifierName2.symbols index a76866cc8af90..c176395ca1c60 100644 --- a/tests/baselines/reference/unicodeIdentifierName2.symbols +++ b/tests/baselines/reference/unicodeIdentifierName2.symbols @@ -1,5 +1,6 @@ === tests/cases/compiler/unicodeIdentifierName2.ts === var a₁ = "hello"; alert(a₁) >a : Symbol(a, Decl(unicodeIdentifierName2.ts, 0, 3)) +>alert : Symbol(alert, Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(unicodeIdentifierName2.ts, 0, 3)) diff --git a/tests/baselines/reference/unicodeIdentifierName2.types b/tests/baselines/reference/unicodeIdentifierName2.types index d6f0f1dbdcd37..7e30ae54ed526 100644 --- a/tests/baselines/reference/unicodeIdentifierName2.types +++ b/tests/baselines/reference/unicodeIdentifierName2.types @@ -2,7 +2,7 @@ var a₁ = "hello"; alert(a₁) >a : any >"hello" : "hello" ->alert(a₁) : any ->alert : any +>alert(a₁) : void +>alert : (message?: any) => void >a : any diff --git a/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.symbols b/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.symbols index 7bc6fd1f17c1d..d3905b6ee1ea9 100644 --- a/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.symbols +++ b/tests/baselines/reference/unionSubtypeIfEveryConstituentTypeIsSubtype.symbols @@ -73,7 +73,7 @@ interface I5 { [x: string]: Date; >x : Symbol(x, Decl(unionSubtypeIfEveryConstituentTypeIsSubtype.ts, 33, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: string | number; >foo : Symbol(I5.foo, Decl(unionSubtypeIfEveryConstituentTypeIsSubtype.ts, 33, 22)) diff --git a/tests/baselines/reference/unionTypeCallSignatures.symbols b/tests/baselines/reference/unionTypeCallSignatures.symbols index 69f7b4d70c94c..23a18efff2206 100644 --- a/tests/baselines/reference/unionTypeCallSignatures.symbols +++ b/tests/baselines/reference/unionTypeCallSignatures.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/types/union/unionTypeCallSignatures.ts === var numOrDate: number | Date; >numOrDate : Symbol(numOrDate, Decl(unionTypeCallSignatures.ts, 0, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var strOrBoolean: string | boolean; >strOrBoolean : Symbol(strOrBoolean, Decl(unionTypeCallSignatures.ts, 1, 3)) @@ -15,7 +15,7 @@ var unionOfDifferentReturnType: { (a: number): number; } | { (a: number): Date; >unionOfDifferentReturnType : Symbol(unionOfDifferentReturnType, Decl(unionTypeCallSignatures.ts, 6, 3)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 6, 35)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 6, 62)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) numOrDate = unionOfDifferentReturnType(10); >numOrDate : Symbol(numOrDate, Decl(unionTypeCallSignatures.ts, 0, 3)) @@ -33,7 +33,7 @@ var unionOfDifferentReturnType1: { (a: number): number; (a: string): string; } | >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 11, 36)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 11, 57)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 11, 84)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 11, 103)) numOrDate = unionOfDifferentReturnType1(10); @@ -54,7 +54,7 @@ var unionOfDifferentParameterTypes: { (a: number): number; } | { (a: string): Da >unionOfDifferentParameterTypes : Symbol(unionOfDifferentParameterTypes, Decl(unionTypeCallSignatures.ts, 17, 3)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 17, 39)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 17, 66)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) unionOfDifferentParameterTypes(10);// error - no call signatures >unionOfDifferentParameterTypes : Symbol(unionOfDifferentParameterTypes, Decl(unionTypeCallSignatures.ts, 17, 3)) @@ -69,7 +69,7 @@ var unionOfDifferentNumberOfSignatures: { (a: number): number; } | { (a: number) >unionOfDifferentNumberOfSignatures : Symbol(unionOfDifferentNumberOfSignatures, Decl(unionTypeCallSignatures.ts, 22, 3)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 22, 43)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 22, 70)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(unionTypeCallSignatures.ts, 22, 89)) unionOfDifferentNumberOfSignatures(); // error - no call signatures diff --git a/tests/baselines/reference/unionTypeCallSignatures2.symbols b/tests/baselines/reference/unionTypeCallSignatures2.symbols index 19279346cde13..9193b90bab52a 100644 --- a/tests/baselines/reference/unionTypeCallSignatures2.symbols +++ b/tests/baselines/reference/unionTypeCallSignatures2.symbols @@ -11,7 +11,7 @@ interface A { (x: Date): void; >x : Symbol(x, Decl(unionTypeCallSignatures2.ts, 3, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) (x: T[]): T[]; >T : Symbol(T, Decl(unionTypeCallSignatures2.ts, 4, 5)) @@ -31,7 +31,7 @@ interface B { (x: Date): void; >x : Symbol(x, Decl(unionTypeCallSignatures2.ts, 10, 5)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) (x: T[]): T[]; >T : Symbol(T, Decl(unionTypeCallSignatures2.ts, 11, 5)) diff --git a/tests/baselines/reference/unionTypeConstructSignatures.symbols b/tests/baselines/reference/unionTypeConstructSignatures.symbols index d4291ecd32659..cd8b873a54386 100644 --- a/tests/baselines/reference/unionTypeConstructSignatures.symbols +++ b/tests/baselines/reference/unionTypeConstructSignatures.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/types/union/unionTypeConstructSignatures.ts === var numOrDate: number | Date; >numOrDate : Symbol(numOrDate, Decl(unionTypeConstructSignatures.ts, 0, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var strOrBoolean: string | boolean; >strOrBoolean : Symbol(strOrBoolean, Decl(unionTypeConstructSignatures.ts, 1, 3)) @@ -15,7 +15,7 @@ var unionOfDifferentReturnType: { new (a: number): number; } | { new (a: number) >unionOfDifferentReturnType : Symbol(unionOfDifferentReturnType, Decl(unionTypeConstructSignatures.ts, 6, 3)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 6, 39)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 6, 70)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) numOrDate = new unionOfDifferentReturnType(10); >numOrDate : Symbol(numOrDate, Decl(unionTypeConstructSignatures.ts, 0, 3)) @@ -33,7 +33,7 @@ var unionOfDifferentReturnType1: { new (a: number): number; new (a: string): str >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 11, 40)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 11, 65)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 11, 96)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 11, 119)) numOrDate = new unionOfDifferentReturnType1(10); @@ -54,7 +54,7 @@ var unionOfDifferentParameterTypes: { new (a: number): number; } | { new (a: str >unionOfDifferentParameterTypes : Symbol(unionOfDifferentParameterTypes, Decl(unionTypeConstructSignatures.ts, 17, 3)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 17, 43)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 17, 74)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) new unionOfDifferentParameterTypes(10);// error - no call signatures >unionOfDifferentParameterTypes : Symbol(unionOfDifferentParameterTypes, Decl(unionTypeConstructSignatures.ts, 17, 3)) @@ -69,7 +69,7 @@ var unionOfDifferentNumberOfSignatures: { new (a: number): number; } | { new (a: >unionOfDifferentNumberOfSignatures : Symbol(unionOfDifferentNumberOfSignatures, Decl(unionTypeConstructSignatures.ts, 22, 3)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 22, 47)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 22, 78)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(unionTypeConstructSignatures.ts, 22, 101)) new unionOfDifferentNumberOfSignatures(); // error - no call signatures diff --git a/tests/baselines/reference/unionTypeIndexSignature.symbols b/tests/baselines/reference/unionTypeIndexSignature.symbols index dc3923f2f241e..ba52a068476a7 100644 --- a/tests/baselines/reference/unionTypeIndexSignature.symbols +++ b/tests/baselines/reference/unionTypeIndexSignature.symbols @@ -1,7 +1,7 @@ === tests/cases/conformance/types/union/unionTypeIndexSignature.ts === var numOrDate: number | Date; >numOrDate : Symbol(numOrDate, Decl(unionTypeIndexSignature.ts, 0, 3)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) var anyVar: number; >anyVar : Symbol(anyVar, Decl(unionTypeIndexSignature.ts, 1, 3)) @@ -13,7 +13,7 @@ var unionOfDifferentReturnType: { [a: string]: number; } | { [a: string]: Date; >unionOfDifferentReturnType : Symbol(unionOfDifferentReturnType, Decl(unionTypeIndexSignature.ts, 6, 3)) >a : Symbol(a, Decl(unionTypeIndexSignature.ts, 6, 35)) >a : Symbol(a, Decl(unionTypeIndexSignature.ts, 6, 62)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) numOrDate = unionOfDifferentReturnType["hello"]; // number | Date >numOrDate : Symbol(numOrDate, Decl(unionTypeIndexSignature.ts, 0, 3)) @@ -41,7 +41,7 @@ var unionOfDifferentReturnType1: { [a: number]: number; } | { [a: number]: Date; >unionOfDifferentReturnType1 : Symbol(unionOfDifferentReturnType1, Decl(unionTypeIndexSignature.ts, 16, 3)) >a : Symbol(a, Decl(unionTypeIndexSignature.ts, 16, 36)) >a : Symbol(a, Decl(unionTypeIndexSignature.ts, 16, 63)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) numOrDate = unionOfDifferentReturnType1["hello"]; // any >numOrDate : Symbol(numOrDate, Decl(unionTypeIndexSignature.ts, 0, 3)) diff --git a/tests/baselines/reference/unknownSymbolOffContextualType1.symbols b/tests/baselines/reference/unknownSymbolOffContextualType1.symbols index 3acf34ec9bf5e..8089af1d1fc33 100644 --- a/tests/baselines/reference/unknownSymbolOffContextualType1.symbols +++ b/tests/baselines/reference/unknownSymbolOffContextualType1.symbols @@ -1,18 +1,18 @@ === tests/cases/compiler/unknownSymbolOffContextualType1.ts === declare var document: Document; ->document : Symbol(document, Decl(unknownSymbolOffContextualType1.ts, 0, 11)) ->Document : Symbol(Document, Decl(unknownSymbolOffContextualType1.ts, 0, 31)) +>document : Symbol(document, Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 0, 11)) +>Document : Symbol(Document, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 0, 31)) interface Document { ->Document : Symbol(Document, Decl(unknownSymbolOffContextualType1.ts, 0, 31)) +>Document : Symbol(Document, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 0, 31)) getElementById(elementId: string): HTMLElement; ->getElementById : Symbol(Document.getElementById, Decl(unknownSymbolOffContextualType1.ts, 1, 20)) +>getElementById : Symbol(Document.getElementById, Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 1, 20)) >elementId : Symbol(elementId, Decl(unknownSymbolOffContextualType1.ts, 2, 19)) ->HTMLElement : Symbol(HTMLElement, Decl(unknownSymbolOffContextualType1.ts, 3, 1)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 3, 1)) } interface HTMLElement { ->HTMLElement : Symbol(HTMLElement, Decl(unknownSymbolOffContextualType1.ts, 3, 1)) +>HTMLElement : Symbol(HTMLElement, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 3, 1)) isDisabled: boolean; >isDisabled : Symbol(HTMLElement.isDisabled, Decl(unknownSymbolOffContextualType1.ts, 4, 23)) @@ -29,9 +29,9 @@ function getMaxWidth(elementNames: string[]) { >name : Symbol(name, Decl(unknownSymbolOffContextualType1.ts, 8, 46)) return document.getElementById(name); ->document.getElementById : Symbol(Document.getElementById, Decl(unknownSymbolOffContextualType1.ts, 1, 20)) ->document : Symbol(document, Decl(unknownSymbolOffContextualType1.ts, 0, 11)) ->getElementById : Symbol(Document.getElementById, Decl(unknownSymbolOffContextualType1.ts, 1, 20)) +>document.getElementById : Symbol(Document.getElementById, Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 1, 20)) +>document : Symbol(document, Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 0, 11)) +>getElementById : Symbol(Document.getElementById, Decl(lib.d.ts, --, --), Decl(unknownSymbolOffContextualType1.ts, 1, 20)) >name : Symbol(name, Decl(unknownSymbolOffContextualType1.ts, 8, 46)) }); diff --git a/tests/baselines/reference/unknownSymbolOffContextualType1.types b/tests/baselines/reference/unknownSymbolOffContextualType1.types index 7df3bd52cc9a9..211231823be6f 100644 --- a/tests/baselines/reference/unknownSymbolOffContextualType1.types +++ b/tests/baselines/reference/unknownSymbolOffContextualType1.types @@ -7,7 +7,7 @@ interface Document { >Document : Document getElementById(elementId: string): HTMLElement; ->getElementById : (elementId: string) => HTMLElement +>getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; } >elementId : string >HTMLElement : HTMLElement } @@ -32,9 +32,9 @@ function getMaxWidth(elementNames: string[]) { return document.getElementById(name); >document.getElementById(name) : HTMLElement ->document.getElementById : (elementId: string) => HTMLElement +>document.getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; } >document : Document ->getElementById : (elementId: string) => HTMLElement +>getElementById : { (elementId: string): HTMLElement; (elementId: string): HTMLElement; } >name : string }); diff --git a/tests/baselines/reference/useObjectValuesAndEntries3.symbols b/tests/baselines/reference/useObjectValuesAndEntries3.symbols index 65d5175eaa68d..1842e5eeb3792 100644 --- a/tests/baselines/reference/useObjectValuesAndEntries3.symbols +++ b/tests/baselines/reference/useObjectValuesAndEntries3.symbols @@ -6,7 +6,7 @@ var o = { a: 1, b: 2 }; for (var x of Object.values(o)) { >x : Symbol(x, Decl(useObjectValuesAndEntries3.ts, 2, 8)) ->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >o : Symbol(o, Decl(useObjectValuesAndEntries3.ts, 0, 3)) let y = x; @@ -16,6 +16,6 @@ for (var x of Object.values(o)) { var entries = Object.entries(o); >entries : Symbol(entries, Decl(useObjectValuesAndEntries3.ts, 6, 3)) ->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --), Decl(lib.es6.d.ts, --, --)) >o : Symbol(o, Decl(useObjectValuesAndEntries3.ts, 0, 3)) diff --git a/tests/baselines/reference/variableDeclarationInStrictMode1.errors.txt b/tests/baselines/reference/variableDeclarationInStrictMode1.errors.txt index 46782aaa1d69d..9143e4c81c8b1 100644 --- a/tests/baselines/reference/variableDeclarationInStrictMode1.errors.txt +++ b/tests/baselines/reference/variableDeclarationInStrictMode1.errors.txt @@ -1,6 +1,6 @@ -lib.d.ts(32,18): error TS2300: Duplicate identifier 'eval'. tests/cases/compiler/variableDeclarationInStrictMode1.ts(2,5): error TS1100: Invalid use of 'eval' in strict mode. tests/cases/compiler/variableDeclarationInStrictMode1.ts(2,5): error TS2300: Duplicate identifier 'eval'. +lib.d.ts(32,18): error TS2300: Duplicate identifier 'eval'. ==== tests/cases/compiler/variableDeclarationInStrictMode1.ts (2 errors) ==== diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints.symbols b/tests/baselines/reference/wrappedAndRecursiveConstraints.symbols index 4f56145951d32..0aa90b3d89d42 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints.symbols +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints.symbols @@ -4,7 +4,7 @@ class C { >C : Symbol(C, Decl(wrappedAndRecursiveConstraints.ts, 0, 0)) >T : Symbol(T, Decl(wrappedAndRecursiveConstraints.ts, 2, 8)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) constructor(public data: T) { } >data : Symbol(C.data, Decl(wrappedAndRecursiveConstraints.ts, 3, 16)) @@ -24,7 +24,7 @@ class C { interface Foo extends Date { >Foo : Symbol(Foo, Decl(wrappedAndRecursiveConstraints.ts, 7, 1)) ->Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) foo: string; >foo : Symbol(Foo.foo, Decl(wrappedAndRecursiveConstraints.ts, 9, 28)) diff --git a/tests/cases/compiler/binopAssignmentShouldHaveType.ts b/tests/cases/compiler/binopAssignmentShouldHaveType.ts index e4325ba4bc6ed..07ee7b7fa6bfd 100644 --- a/tests/cases/compiler/binopAssignmentShouldHaveType.ts +++ b/tests/cases/compiler/binopAssignmentShouldHaveType.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare var console; "use strict"; module Test { diff --git a/tests/cases/compiler/capturedLetConstInLoop13.ts b/tests/cases/compiler/capturedLetConstInLoop13.ts index 0aa00b0e1a0f1..aa304fe21e6f7 100644 --- a/tests/cases/compiler/capturedLetConstInLoop13.ts +++ b/tests/cases/compiler/capturedLetConstInLoop13.ts @@ -1,3 +1,4 @@ +// @lib: es5 class Main { constructor() { diff --git a/tests/cases/compiler/classExpressionWithStaticProperties3.ts b/tests/cases/compiler/classExpressionWithStaticProperties3.ts index 7c733c458be84..344dc17f0382e 100644 --- a/tests/cases/compiler/classExpressionWithStaticProperties3.ts +++ b/tests/cases/compiler/classExpressionWithStaticProperties3.ts @@ -1,4 +1,5 @@ -//@target: es5 +// @lib: es5 +// @target: es5 declare var console: any; const arr: {y(): number}[] = []; diff --git a/tests/cases/compiler/classExpressionWithStaticPropertiesES63.ts b/tests/cases/compiler/classExpressionWithStaticPropertiesES63.ts index 939a344f9bb05..3b6ddb7dac285 100644 --- a/tests/cases/compiler/classExpressionWithStaticPropertiesES63.ts +++ b/tests/cases/compiler/classExpressionWithStaticPropertiesES63.ts @@ -1,4 +1,5 @@ -//@target: es6 +// @lib: es5 +// @target: es6 declare var console: any; const arr: {y(): number}[] = []; diff --git a/tests/cases/compiler/classMemberInitializerWithLamdaScoping.ts b/tests/cases/compiler/classMemberInitializerWithLamdaScoping.ts index c49c0b1a6258b..e634cbf7c5aea 100644 --- a/tests/cases/compiler/classMemberInitializerWithLamdaScoping.ts +++ b/tests/cases/compiler/classMemberInitializerWithLamdaScoping.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare var console: { log(msg?: any): void; }; diff --git a/tests/cases/compiler/classMemberInitializerWithLamdaScoping2.ts b/tests/cases/compiler/classMemberInitializerWithLamdaScoping2.ts index 8453c3dae283b..b17b1ca9d4642 100644 --- a/tests/cases/compiler/classMemberInitializerWithLamdaScoping2.ts +++ b/tests/cases/compiler/classMemberInitializerWithLamdaScoping2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @Filename: classMemberInitializerWithLamdaScoping2_0.ts var field1: string; diff --git a/tests/cases/compiler/classMemberInitializerWithLamdaScoping5.ts b/tests/cases/compiler/classMemberInitializerWithLamdaScoping5.ts index 104f1daea922c..3d05a465f1a41 100644 --- a/tests/cases/compiler/classMemberInitializerWithLamdaScoping5.ts +++ b/tests/cases/compiler/classMemberInitializerWithLamdaScoping5.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare var console: { log(message?: any, ...optionalParams: any[]): void; }; diff --git a/tests/cases/compiler/classMemberWithMissingIdentifier2.ts b/tests/cases/compiler/classMemberWithMissingIdentifier2.ts index e16186597970a..6b1587361ab8b 100644 --- a/tests/cases/compiler/classMemberWithMissingIdentifier2.ts +++ b/tests/cases/compiler/classMemberWithMissingIdentifier2.ts @@ -1,3 +1,4 @@ +// @lib: es5 class C { public {[name:string]:VariableDeclaration}; } \ No newline at end of file diff --git a/tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts b/tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts index dbce96c1826d9..a41bb05d7e818 100644 --- a/tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts +++ b/tests/cases/compiler/collisionRestParameterUnderscoreIUsage.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare var console: { log(msg?: string): void; }; var _i = "This is what I'd expect to see"; class Foo { diff --git a/tests/cases/compiler/collisionSuperAndNameResolution.ts b/tests/cases/compiler/collisionSuperAndNameResolution.ts index 8bdd1f3987d21..4e08fe96982f6 100644 --- a/tests/cases/compiler/collisionSuperAndNameResolution.ts +++ b/tests/cases/compiler/collisionSuperAndNameResolution.ts @@ -1,3 +1,4 @@ +// @lib: es5 var console: { log(message: any); } diff --git a/tests/cases/compiler/collisionThisExpressionAndLocalVarInFunction.ts b/tests/cases/compiler/collisionThisExpressionAndLocalVarInFunction.ts index dc704a32fb278..feb3fe25379b3 100644 --- a/tests/cases/compiler/collisionThisExpressionAndLocalVarInFunction.ts +++ b/tests/cases/compiler/collisionThisExpressionAndLocalVarInFunction.ts @@ -1,3 +1,4 @@ +// @lib: es5 var console: { log(val: any); } diff --git a/tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts b/tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts index 99b13763d3136..f70c6a5a457e1 100644 --- a/tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts +++ b/tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare function alert(message?: any): void; var x = { diff --git a/tests/cases/compiler/collisionThisExpressionAndNameResolution.ts b/tests/cases/compiler/collisionThisExpressionAndNameResolution.ts index 5311e916e3c21..d479498e2256a 100644 --- a/tests/cases/compiler/collisionThisExpressionAndNameResolution.ts +++ b/tests/cases/compiler/collisionThisExpressionAndNameResolution.ts @@ -1,3 +1,4 @@ +// @lib: es5 var console : { log(message: any); } diff --git a/tests/cases/compiler/collisionThisExpressionAndParameter.ts b/tests/cases/compiler/collisionThisExpressionAndParameter.ts index fa0c84684a256..fc7410bcf7d99 100644 --- a/tests/cases/compiler/collisionThisExpressionAndParameter.ts +++ b/tests/cases/compiler/collisionThisExpressionAndParameter.ts @@ -1,3 +1,4 @@ +// @lib: es5 class Foo { x() { var _this = 10; // Local var. No this capture in x(), so no conflict. @@ -31,20 +32,20 @@ class Foo { } } class Foo1 { - constructor(_this: number) { // Error - var x2 = { - doStuff: (callback) => () => { - return callback(this); - } - } + constructor(_this: number) { // Error + var x2 = { + doStuff: (callback) => () => { + return callback(this); + } + } } } declare var console: { log(msg: any); } -function f1(_this: number) { - x => { console.log(this.x); }; +function f1(_this: number) { + x => { console.log(this.x); }; } declare class Foo2 { @@ -56,12 +57,12 @@ declare function f2(_this: number); // no error class Foo3 { constructor(_this: string); // no code gen - no error constructor(_this: number); // no code gen - no error - constructor(_this: any) { // Error - var x2 = { - doStuff: (callback) => () => { - return callback(this); - } - } + constructor(_this: any) { // Error + var x2 = { + doStuff: (callback) => () => { + return callback(this); + } + } } z(_this: string); // no code gen - no error @@ -78,8 +79,8 @@ declare var console: { function f3(_this: number); // no code gen - no error function f3(_this: string); // no code gen - no error -function f3(_this: any) { - x => { console.log(this.x); }; +function f3(_this: any) { + x => { console.log(this.x); }; } declare class Foo4 { diff --git a/tests/cases/compiler/constEnumErrors.ts b/tests/cases/compiler/constEnumErrors.ts index 87e6b7ccb98fd..be45ed8363221 100644 --- a/tests/cases/compiler/constEnumErrors.ts +++ b/tests/cases/compiler/constEnumErrors.ts @@ -1,3 +1,4 @@ +// @lib: es5 const enum E { A } diff --git a/tests/cases/compiler/contextualTypingOfTooShortOverloads.ts b/tests/cases/compiler/contextualTypingOfTooShortOverloads.ts index 6fa88a1e5595a..cbc0769bd6661 100644 --- a/tests/cases/compiler/contextualTypingOfTooShortOverloads.ts +++ b/tests/cases/compiler/contextualTypingOfTooShortOverloads.ts @@ -1,3 +1,4 @@ +// @lib: es5 // small repro from #11875 var use: Overload; use((req, res) => {}); diff --git a/tests/cases/compiler/decoratorWithUnderscoreMethod.ts b/tests/cases/compiler/decoratorWithUnderscoreMethod.ts index e6551c9128484..2cc8ff88d4688 100644 --- a/tests/cases/compiler/decoratorWithUnderscoreMethod.ts +++ b/tests/cases/compiler/decoratorWithUnderscoreMethod.ts @@ -1,4 +1,5 @@ -// @noemithelpers: true +// @lib: es5 +// @noemithelpers: true // @experimentaldecorators: true declare var console : { log(arg: string): void }; diff --git a/tests/cases/compiler/fatarrowfunctions.ts b/tests/cases/compiler/fatarrowfunctions.ts index 2afa4c54b4a6a..0e794ac88864a 100644 --- a/tests/cases/compiler/fatarrowfunctions.ts +++ b/tests/cases/compiler/fatarrowfunctions.ts @@ -1,3 +1,4 @@ +// @lib: es5 function foo(x:any) { return x(); diff --git a/tests/cases/compiler/fatarrowfunctionsInFunctions.ts b/tests/cases/compiler/fatarrowfunctionsInFunctions.ts index 67bbfeb163943..9d1a5edc893b6 100644 --- a/tests/cases/compiler/fatarrowfunctionsInFunctions.ts +++ b/tests/cases/compiler/fatarrowfunctionsInFunctions.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare function setTimeout(expression: any, msec?: number, language?: any): number; var messenger = { diff --git a/tests/cases/compiler/genericMethodOverspecialization.ts b/tests/cases/compiler/genericMethodOverspecialization.ts index 60dc46980e86a..241f4941b9125 100644 --- a/tests/cases/compiler/genericMethodOverspecialization.ts +++ b/tests/cases/compiler/genericMethodOverspecialization.ts @@ -1,3 +1,4 @@ +// @lib: es5 var names = ["list", "table1", "table2", "table3", "summary"]; interface HTMLElement { diff --git a/tests/cases/compiler/interfaceExtendsClass1.ts b/tests/cases/compiler/interfaceExtendsClass1.ts index 64c51563668f5..8c84eba81b06c 100644 --- a/tests/cases/compiler/interfaceExtendsClass1.ts +++ b/tests/cases/compiler/interfaceExtendsClass1.ts @@ -1,3 +1,4 @@ +// @lib: es5 class Control { private state: any; } diff --git a/tests/cases/compiler/lambdaArgCrash.ts b/tests/cases/compiler/lambdaArgCrash.ts index c2e2bba411730..3151c2521ac7b 100644 --- a/tests/cases/compiler/lambdaArgCrash.ts +++ b/tests/cases/compiler/lambdaArgCrash.ts @@ -1,3 +1,4 @@ +// @lib: es5 class Event { private _listeners: any[] = []; diff --git a/tests/cases/compiler/letConstMatchingParameterNames.ts b/tests/cases/compiler/letConstMatchingParameterNames.ts index e749912ad826f..ceb3773bf4634 100644 --- a/tests/cases/compiler/letConstMatchingParameterNames.ts +++ b/tests/cases/compiler/letConstMatchingParameterNames.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @target: es5 let parent = true; const parent2 = true; diff --git a/tests/cases/compiler/maximum10SpellingSuggestions.ts b/tests/cases/compiler/maximum10SpellingSuggestions.ts index 7aa27dc1e2ad0..e857a66d8eade 100644 --- a/tests/cases/compiler/maximum10SpellingSuggestions.ts +++ b/tests/cases/compiler/maximum10SpellingSuggestions.ts @@ -1,3 +1,4 @@ +// @lib: es5 // 10 bobs on the first line // the last two bobs should not have did-you-mean spelling suggestions var blob; diff --git a/tests/cases/compiler/moduleVariables.ts b/tests/cases/compiler/moduleVariables.ts index 0b813f75ce494..b53b43a5ba2df 100644 --- a/tests/cases/compiler/moduleVariables.ts +++ b/tests/cases/compiler/moduleVariables.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare var console: any; var x = 1; diff --git a/tests/cases/compiler/module_augmentExistingAmbientVariable.ts b/tests/cases/compiler/module_augmentExistingAmbientVariable.ts index 53a2842ed3fdc..4972714a82fdb 100644 --- a/tests/cases/compiler/module_augmentExistingAmbientVariable.ts +++ b/tests/cases/compiler/module_augmentExistingAmbientVariable.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare var console: any; module console { diff --git a/tests/cases/compiler/module_augmentExistingVariable.ts b/tests/cases/compiler/module_augmentExistingVariable.ts index bf192c8d113cf..266c3ad4d7fc1 100644 --- a/tests/cases/compiler/module_augmentExistingVariable.ts +++ b/tests/cases/compiler/module_augmentExistingVariable.ts @@ -1,3 +1,4 @@ +// @lib: es5 var console: any; module console { diff --git a/tests/cases/compiler/noCollisionThisExpressionAndLocalVarInFunction.ts b/tests/cases/compiler/noCollisionThisExpressionAndLocalVarInFunction.ts index 1b6c6270cb545..6e931b77de270 100644 --- a/tests/cases/compiler/noCollisionThisExpressionAndLocalVarInFunction.ts +++ b/tests/cases/compiler/noCollisionThisExpressionAndLocalVarInFunction.ts @@ -1,3 +1,4 @@ +// @lib: es5 var console: { log(val: any); } diff --git a/tests/cases/compiler/noCollisionThisExpressionInFunctionAndVarInGlobal.ts b/tests/cases/compiler/noCollisionThisExpressionInFunctionAndVarInGlobal.ts index 15b2a18932819..3f23fcf1258ab 100644 --- a/tests/cases/compiler/noCollisionThisExpressionInFunctionAndVarInGlobal.ts +++ b/tests/cases/compiler/noCollisionThisExpressionInFunctionAndVarInGlobal.ts @@ -1,3 +1,4 @@ +// @lib: es5 var console: { log(val: any); } diff --git a/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts b/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts index 23cd2ba45f8da..b24b174db2ceb 100644 --- a/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts +++ b/tests/cases/compiler/numericLiteralsWithTrailingDecimalPoints01.ts @@ -1,3 +1,4 @@ +// @lib: es5 1..toString(); 1.0.toString(); 1.toString(); diff --git a/tests/cases/compiler/objectLitArrayDeclNoNew.ts b/tests/cases/compiler/objectLitArrayDeclNoNew.ts index d4e0d6e946865..f089a99e67b94 100644 --- a/tests/cases/compiler/objectLitArrayDeclNoNew.ts +++ b/tests/cases/compiler/objectLitArrayDeclNoNew.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare var console; "use strict"; module Test { diff --git a/tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts b/tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts index 4e07771c8d124..4e530469e4b43 100644 --- a/tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts +++ b/tests/cases/compiler/overloadingStaticFunctionsInFunctions.ts @@ -1,3 +1,4 @@ +// @lib: es5 function boo { static test() static test(name:string) diff --git a/tests/cases/compiler/recursiveClassReferenceTest.ts b/tests/cases/compiler/recursiveClassReferenceTest.ts index d62923b0fe8e0..0c4619eb2421d 100644 --- a/tests/cases/compiler/recursiveClassReferenceTest.ts +++ b/tests/cases/compiler/recursiveClassReferenceTest.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true // Scenario 1: Test reqursive function call with "this" parameter // Scenario 2: Test recursive function call with cast and "this" parameter diff --git a/tests/cases/compiler/recursiveNamedLambdaCall.ts b/tests/cases/compiler/recursiveNamedLambdaCall.ts index 6b940491704f4..0c0a28d15e4f8 100644 --- a/tests/cases/compiler/recursiveNamedLambdaCall.ts +++ b/tests/cases/compiler/recursiveNamedLambdaCall.ts @@ -1,3 +1,4 @@ +// @lib: es5 var promise = function( obj ) { if ( top && top.doScroll ) { diff --git a/tests/cases/compiler/recursiveSpecializationOfExtendedTypeWithError.ts b/tests/cases/compiler/recursiveSpecializationOfExtendedTypeWithError.ts index a1353d180f410..7a4666114c7ab 100644 --- a/tests/cases/compiler/recursiveSpecializationOfExtendedTypeWithError.ts +++ b/tests/cases/compiler/recursiveSpecializationOfExtendedTypeWithError.ts @@ -1,3 +1,4 @@ +// @lib: es5 interface HTMLSelectElement { options: HTMLSelectElement; (name: A): any; diff --git a/tests/cases/compiler/selfInLambdas.ts b/tests/cases/compiler/selfInLambdas.ts index 659b77fa4584e..243b2470e8b1e 100644 --- a/tests/cases/compiler/selfInLambdas.ts +++ b/tests/cases/compiler/selfInLambdas.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @noImplicitAny: true // @noImplicitThis: true diff --git a/tests/cases/compiler/selfRef.ts b/tests/cases/compiler/selfRef.ts index f78fef24c93d1..1f8a079789c71 100644 --- a/tests/cases/compiler/selfRef.ts +++ b/tests/cases/compiler/selfRef.ts @@ -1,3 +1,4 @@ +// @lib: es5 module M { export class Test diff --git a/tests/cases/compiler/shebangError.ts b/tests/cases/compiler/shebangError.ts index 91a27a65aa009..c700e7f3716f2 100644 --- a/tests/cases/compiler/shebangError.ts +++ b/tests/cases/compiler/shebangError.ts @@ -1,2 +1,3 @@ +// @lib: es5 var foo = 'Shebang is only allowed on the first line'; #!/usr/bin/env node \ No newline at end of file diff --git a/tests/cases/compiler/sourceMap-StringLiteralWithNewLine.ts b/tests/cases/compiler/sourceMap-StringLiteralWithNewLine.ts index 756882ecc3f00..a4ddd242d4a6a 100644 --- a/tests/cases/compiler/sourceMap-StringLiteralWithNewLine.ts +++ b/tests/cases/compiler/sourceMap-StringLiteralWithNewLine.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @target: ES3 // @sourcemap: true diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts index cd1ad012b2560..9754508418d85 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts index 597f40afe86e5..3a65e22a56032 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPattern2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts index 36c3c8cb48c52..738ca45a2688f 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts index 4e0e5d053b3c3..0e4c3a9604fd3 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForArrayBindingPatternDefaultValues2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts index 7d5471db32417..7b382322a8a05 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts index 3e018b2a6d5fb..38debd76a5df0 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPattern2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts index 22c9ecdf66dfb..2b9bcdf335df0 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts index 0240a82c40b3a..168bb56d25e9d 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForObjectBindingPatternDefaultValues2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts index f2fb461f44362..f09df156b7e22 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts index 365a030f8e99b..022dd5acb88d5 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPattern2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts index a619fc1c42fa3..5f37fd6f5c8db 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts index ac0c877456764..d82e126ac8cbe 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfArrayBindingPatternDefaultValues2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts index df822f89bc079..5b1d77437942e 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts index 7f71e7d6bddee..629f14960c358 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPattern2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts index d8f88189c0110..67485eda08f96 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts index 01d2f6133a351..5f2de97ee30c0 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringForOfObjectBindingPatternDefaultValues2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts index 062acd823ac84..e8093d8a5c653 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: string): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts index c9dd735e8b6b5..2eb0ebf5c302b 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterNestedObjectBindingPatternDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: string): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts index 0f52806dd165d..492d4346fde4d 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true interface Robot { name: string; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts index 6fc9c5a605e10..1f5ec9c39f60a 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringParameterObjectBindingPatternDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true interface Robot { name?: string; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts index 731dc7f26571b..f0d0417dc93f9 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts index 07c2a24e70e07..a992d3439ad8a 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPattern2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts index 345d396515607..dad5b98b8492f 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts index 83f95c09c02e0..d1aed4c5f1db8 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringParametertArrayBindingPatternDefaultValues2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts index 88e49498f60f1..c03466c53703e 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true interface Robot { name: string; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts index 3697402bbcf2b..56e653415b9af 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatement1.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true interface Robot { name: string; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts index 3ac03143aa278..048ba0d67e4a5 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: string): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts index 27497f2c220e8..7de9d85770502 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: string): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts index 78ed29c397bff..26575e45667b6 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPattern3.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts index fb942310389e2..c66a94144ea8e 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: string): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts index 4b4ef07d23290..980be70433322 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues2.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: string): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts index 253d96d4b35fc..92fa65d2a41f3 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: any): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts index b95e7e5464a55..f04bb27937cee 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true interface Robot { name: string; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts index a40e5f11ebb38..f8c846ac4b333 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPattern.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: string): void; diff --git a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts index 95eda6f205023..2c3980e6926db 100644 --- a/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts +++ b/tests/cases/compiler/sourceMapValidationDestructuringVariableStatementNestedObjectBindingPatternWithDefaultValues.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @sourcemap: true declare var console: { log(msg: string): void; diff --git a/tests/cases/compiler/staticInstanceResolution.ts b/tests/cases/compiler/staticInstanceResolution.ts index 50e9f5a1bdcdc..01c6726aff015 100644 --- a/tests/cases/compiler/staticInstanceResolution.ts +++ b/tests/cases/compiler/staticInstanceResolution.ts @@ -1,3 +1,4 @@ +// @lib: es5 class Comment { public getDocCommentText() diff --git a/tests/cases/compiler/staticsInAFunction.ts b/tests/cases/compiler/staticsInAFunction.ts index d546c17d912ea..3b6a3a23261e2 100644 --- a/tests/cases/compiler/staticsInAFunction.ts +++ b/tests/cases/compiler/staticsInAFunction.ts @@ -1,3 +1,4 @@ +// @lib: es5 function boo{ static test() static test(name:string) diff --git a/tests/cases/compiler/unusedLocalProperty.ts b/tests/cases/compiler/unusedLocalProperty.ts index fdd33116135fc..5ff404ac8b98f 100644 --- a/tests/cases/compiler/unusedLocalProperty.ts +++ b/tests/cases/compiler/unusedLocalProperty.ts @@ -1,4 +1,5 @@ -//@noUnusedLocals:true +// @lib: es5 +// @noUnusedLocals: true declare var console: { log(msg: any): void; } class Animal { constructor(private species: string) { diff --git a/tests/cases/compiler/unusedLocalsAndObjectSpread.ts b/tests/cases/compiler/unusedLocalsAndObjectSpread.ts index b042b412c8e33..c6aab5ab59827 100644 --- a/tests/cases/compiler/unusedLocalsAndObjectSpread.ts +++ b/tests/cases/compiler/unusedLocalsAndObjectSpread.ts @@ -1,4 +1,5 @@ -//@noUnusedLocals:true +// @lib: es5 +// @noUnusedLocals: true declare var console: { log(a: any): void }; diff --git a/tests/cases/compiler/variableDeclaratorResolvedDuringContextualTyping.ts b/tests/cases/compiler/variableDeclaratorResolvedDuringContextualTyping.ts index dbb1a653c33df..e794087e01ec4 100644 --- a/tests/cases/compiler/variableDeclaratorResolvedDuringContextualTyping.ts +++ b/tests/cases/compiler/variableDeclaratorResolvedDuringContextualTyping.ts @@ -1,3 +1,4 @@ +// @lib: es5 module WinJS { export interface ValueCallback { (value: any): any; diff --git a/tests/cases/conformance/dynamicImport/importCallExpression4ESNext.ts b/tests/cases/conformance/dynamicImport/importCallExpression4ESNext.ts index 7bc540e1e2a3f..43c1f7182b678 100644 --- a/tests/cases/conformance/dynamicImport/importCallExpression4ESNext.ts +++ b/tests/cases/conformance/dynamicImport/importCallExpression4ESNext.ts @@ -11,7 +11,6 @@ export function foo() { return "foo" } export function backup() { return "backup"; } // @filename: 2.ts -declare var console: any; class C { private myModule = import("./0"); method() { diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNoModuleKindSpecified.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNoModuleKindSpecified.ts index 856f763eb5696..414fe10631434 100644 --- a/tests/cases/conformance/dynamicImport/importCallExpressionNoModuleKindSpecified.ts +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNoModuleKindSpecified.ts @@ -9,7 +9,6 @@ export function foo() { return "foo" } export function backup() { return "backup"; } // @filename: 2.ts -declare var console: any; class C { private myModule = import("./0"); method() { diff --git a/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts b/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts index 111abd70ac30f..c044d60a680b5 100644 --- a/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts +++ b/tests/cases/conformance/es6/destructuring/iterableArrayPattern28.ts @@ -1,3 +1,4 @@ +//@lib: es2015 //@target: ES6 function takeFirstTwoEntries(...[[k1, v1], [k2, v2]]: [string, number][]) { } takeFirstTwoEntries(...new Map([["", 0], ["hello", true]])); \ No newline at end of file diff --git a/tests/cases/conformance/es6/for-ofStatements/for-of39.ts b/tests/cases/conformance/es6/for-ofStatements/for-of39.ts index 1d3ae5fc76c5b..1b6d303f5745c 100644 --- a/tests/cases/conformance/es6/for-ofStatements/for-of39.ts +++ b/tests/cases/conformance/es6/for-ofStatements/for-of39.ts @@ -1,4 +1,5 @@ -//@target: ES6 +//@lib: es2015 +//@target: ES6 var map = new Map([["", true], ["", 0]]); for (var [k, v] of map) { k; diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts index 38782100166bf..a5f5d77415790 100644 --- a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignment.ts @@ -1,4 +1,5 @@ -var id: number = 10000; +// @lib: es5 +var id: number = 10000; var name: string = "my name"; var person: { name: string; id: number } = { name, id }; diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts index 19fd21b47b573..bfd20d3db8a9e 100644 --- a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentES6.ts @@ -1,4 +1,5 @@ -// @target: es6 +// @lib: es2015 +// @target: es6 var id: number = 10000; var name: string = "my name"; diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts index 55f10aec93200..7e58ab34bdd4c 100644 --- a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentError.ts @@ -1,4 +1,5 @@ -var id: number = 10000; +// @lib: es5 +var id: number = 10000; var name: string = "my name"; var person: { b: string; id: number } = { name, id }; // error diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts index 104be41a8390f..9757e65e7b9d3 100644 --- a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesAssignmentErrorFromMissingIdentifier.ts @@ -1,4 +1,5 @@ -var id: number = 10000; +// @lib: es5 +var id: number = 10000; var name: string = "my name"; var person: { b: string; id: number } = { name, id }; // error diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts index c50c4e3fbdf9a..5f3b6514a6992 100644 --- a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument.ts @@ -1,4 +1,5 @@ -var id: number = 10000; +// @lib: es5 +var id: number = 10000; var name: string = "my name"; var person = { name, id }; diff --git a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts index 45c248a591145..883d421466d78 100644 --- a/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts +++ b/tests/cases/conformance/es6/shorthandPropertyAssignment/objectLiteralShorthandPropertiesFunctionArgument2.ts @@ -1,4 +1,5 @@ -var id: number = 10000; +// @lib: es5 +var id: number = 10000; var name: string = "my name"; var person = { name, id }; diff --git a/tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration17.ts b/tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration17.ts index e4fc27adccd85..a709f7d7bcca0 100644 --- a/tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration17.ts +++ b/tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration17.ts @@ -1,3 +1,4 @@ +// @lib: es5 declare class Enumerator { public atEnd(): boolean; public moveNext(); diff --git a/tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPostfixExpression1.ts b/tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPostfixExpression1.ts index 3a61130d42962..887bfadd3a203 100644 --- a/tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPostfixExpression1.ts +++ b/tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPostfixExpression1.ts @@ -1 +1,2 @@ +// @lib: es5 a--.toString() \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts b/tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts index 31753a8ac7215..4cb9c6cb75dc8 100644 --- a/tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts +++ b/tests/cases/conformance/parser/ecmascript5/RealWorld/parserharness.ts @@ -1,4 +1,5 @@ -// +// @lib: es5 +// // Copyright (c) Microsoft Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/tests/cases/conformance/parser/ecmascript5/parserRealSource5.ts b/tests/cases/conformance/parser/ecmascript5/parserRealSource5.ts index 32b29e574d289..c422a7eed3a84 100644 --- a/tests/cases/conformance/parser/ecmascript5/parserRealSource5.ts +++ b/tests/cases/conformance/parser/ecmascript5/parserRealSource5.ts @@ -1,3 +1,4 @@ +// @lib: es5 // 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. diff --git a/tests/cases/conformance/parser/ecmascript6/ShorthandPropertyAssignment/parserShorthandPropertyAssignment1.ts b/tests/cases/conformance/parser/ecmascript6/ShorthandPropertyAssignment/parserShorthandPropertyAssignment1.ts index 9ef2f06cdfc5f..5a12efa7797bd 100644 --- a/tests/cases/conformance/parser/ecmascript6/ShorthandPropertyAssignment/parserShorthandPropertyAssignment1.ts +++ b/tests/cases/conformance/parser/ecmascript6/ShorthandPropertyAssignment/parserShorthandPropertyAssignment1.ts @@ -1,3 +1,4 @@ +// @lib: es5 function foo(obj: { name?: string; id: number }) { } var name:any, id: any; foo({ name?, id? }); \ No newline at end of file diff --git a/tests/cases/conformance/references/library-reference-2.ts b/tests/cases/conformance/references/library-reference-2.ts index 9ac7cd4f4d321..09ed15f653ded 100644 --- a/tests/cases/conformance/references/library-reference-2.ts +++ b/tests/cases/conformance/references/library-reference-2.ts @@ -1,7 +1,7 @@ // @noImplicitReferences: true // @traceResolution: true // @typeRoots: /types -// @currentDirectory: test +// @currentDirectory: /test // package.json in a primary reference can refer to another file diff --git a/tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts b/tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts index b18dc498bb6c3..71c5e195bee15 100644 --- a/tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts +++ b/tests/cases/conformance/types/members/objectTypeHidingMembersOfExtendedObject.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @skipDefaultLibCheck: false class A { foo: string; diff --git a/tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts b/tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts index 797ad2cb09153..971fe01987b1f 100644 --- a/tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts +++ b/tests/cases/conformance/types/members/objectTypeWithStringIndexerHidingObjectIndexer.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @skipDefaultLibCheck: false // object types can define string indexers that are more specific than the default 'any' that would be returned // no errors expected below diff --git a/tests/cases/conformance/types/never/neverInference.ts b/tests/cases/conformance/types/never/neverInference.ts index 1258a35e3d311..0501f9540c922 100644 --- a/tests/cases/conformance/types/never/neverInference.ts +++ b/tests/cases/conformance/types/never/neverInference.ts @@ -1,3 +1,4 @@ +// @lib: es5 // @strict: true declare function f(x: T[]): T; diff --git a/tests/cases/conformance/types/spread/objectSpreadNegativeParse.ts b/tests/cases/conformance/types/spread/objectSpreadNegativeParse.ts index 47fd787ec9a35..4d0aafab7a1fe 100644 --- a/tests/cases/conformance/types/spread/objectSpreadNegativeParse.ts +++ b/tests/cases/conformance/types/spread/objectSpreadNegativeParse.ts @@ -1,3 +1,4 @@ +// @lib: es5 let o7 = { ...o? }; let o8 = { ...*o }; let o9 = { ...matchMedia() { }}; From cf261c34aad403f775ddbb025bfbbb9f5733f761 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 9 Nov 2017 16:08:40 -0800 Subject: [PATCH 08/54] Retire Harness.compileFiles --- src/harness/compiler.ts | 8 +- src/harness/compilerRunner.ts | 4 +- src/harness/harness.ts | 156 ------------------- src/harness/unittests/programMissingFiles.ts | 15 +- src/harness/utils.ts | 2 + src/harness/vfs.ts | 4 +- 6 files changed, 19 insertions(+), 170 deletions(-) diff --git a/src/harness/compiler.ts b/src/harness/compiler.ts index c6f0f831f81f2..6b4fcc62422c1 100644 --- a/src/harness/compiler.ts +++ b/src/harness/compiler.ts @@ -16,6 +16,7 @@ namespace compiler { public readonly defaultLibLocation: string; public readonly outputs: TextDocument[] = []; public readonly traces: string[] = []; + public readonly shouldAssertInvariants = !Harness.lightMode; private _setParentNodes: boolean; private _sourceFiles: KeyedCollection; @@ -130,7 +131,12 @@ namespace compiler { } } - const parsed = ts.createSourceFile(fileName, content, languageVersion, this._setParentNodes); + + const parsed = ts.createSourceFile(fileName, content, languageVersion, this._setParentNodes || this.shouldAssertInvariants); + if (this.shouldAssertInvariants) { + Utils.assertInvariants(parsed, /*parent*/ undefined); + } + this._sourceFiles.set(canonicalFileName, parsed); if (cacheKey) { diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index d8f82abe4eca4..7aa26b9c8cd83 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -46,8 +46,8 @@ class CompilerBaselineRunner extends RunnerBase { } private makeUnitName(name: string, root: string) { - const path = ts.toPath(name, root, (fileName) => Harness.Compiler.getCanonicalFileName(fileName)); - const pathStart = ts.toPath(Harness.IO.getCurrentDirectory(), "", (fileName) => Harness.Compiler.getCanonicalFileName(fileName)); + const path = ts.toPath(name, root, utils.identity); + const pathStart = ts.toPath(Harness.IO.getCurrentDirectory(), "", utils.identity); return pathStart ? path.replace(pathStart, "/") : path; } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 964662aaa3ea2..2ab0b8c7a35bf 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1030,19 +1030,12 @@ namespace Harness { return result; } - const carriageReturnLineFeed = "\r\n"; - const lineFeed = "\n"; - export const defaultLibFileName = "lib.d.ts"; export const es2015DefaultLibFileName = "lib.es2015.d.ts"; // Cache of lib files from "built/local" let libFileNameSourceFileMap: ts.Map | undefined; - // Cache of lib files from "tests/lib/" - const testLibFileNameSourceFileMap = ts.createMap(); - const es6TestLibFileNameSourceFileMap = ts.createMap(); - export function getDefaultLibrarySourceFile(fileName = defaultLibFileName): ts.SourceFile { if (!isDefaultLibraryFile(fileName)) { return undefined; @@ -1084,155 +1077,6 @@ namespace Harness { return fileName; } - export function createCompilerHost( - inputFiles: TestFile[], - writeFile: (fn: string, contents: string, writeByteOrderMark: boolean) => void, - scriptTarget: ts.ScriptTarget, - useCaseSensitiveFileNames: boolean, - // the currentDirectory is needed for rwcRunner to passed in specified current directory to compiler host - currentDirectory: string, - newLineKind?: ts.NewLineKind, - libFiles?: string): ts.CompilerHost { - - // Local get canonical file name function, that depends on passed in parameter for useCaseSensitiveFileNames - const getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); - - /** Maps a symlink name to a realpath. Used only for exposing `realpath`. */ - const realPathMap = ts.createMap(); - /** - * Maps a file name to a source file. - * This will have a different SourceFile for every symlink pointing to that file; - * if the program resolves realpaths then symlink entries will be ignored. - */ - const fileMap = ts.createMap(); - for (const file of inputFiles) { - if (file.content !== undefined) { - const fileName = ts.normalizePath(file.unitName); - const path = ts.toPath(file.unitName, currentDirectory, getCanonicalFileName); - if (file.fileOptions && file.fileOptions.symlink) { - const links = file.fileOptions.symlink.split(","); - for (const link of links) { - const linkPath = ts.toPath(link, currentDirectory, getCanonicalFileName); - realPathMap.set(linkPath, fileName); - // Create a different SourceFile for every symlink. - const sourceFile = createSourceFileAndAssertInvariants(linkPath, file.content, scriptTarget); - fileMap.set(linkPath, sourceFile); - } - } - const sourceFile = createSourceFileAndAssertInvariants(fileName, file.content, scriptTarget); - fileMap.set(path, sourceFile); - } - } - - if (libFiles) { - // Because @libFiles don't change between execution. We would cache the result of the files and reuse it to speed help compilation - for (const fileName of libFiles.split(",")) { - const libFileName = "tests/lib/" + fileName; - - if (scriptTarget <= ts.ScriptTarget.ES5) { - if (!testLibFileNameSourceFileMap.get(libFileName)) { - testLibFileNameSourceFileMap.set(libFileName, createSourceFileAndAssertInvariants(libFileName, IO.readFile(libFileName), scriptTarget)); - } - } - else { - if (!es6TestLibFileNameSourceFileMap.get(libFileName)) { - es6TestLibFileNameSourceFileMap.set(libFileName, createSourceFileAndAssertInvariants(libFileName, IO.readFile(libFileName), scriptTarget)); - } - } - } - } - - function getSourceFile(fileName: string) { - fileName = ts.normalizePath(fileName); - const fromFileMap = fileMap.get(toPath(fileName)); - if (fromFileMap) { - return fromFileMap; - } - else if (fileName === fourslashFileName) { - const tsFn = "tests/cases/fourslash/" + fourslashFileName; - fourslashSourceFile = fourslashSourceFile || createSourceFileAndAssertInvariants(tsFn, Harness.IO.readFile(tsFn), scriptTarget); - return fourslashSourceFile; - } - else if (ts.startsWith(fileName, "tests/lib/")) { - return scriptTarget <= ts.ScriptTarget.ES5 ? testLibFileNameSourceFileMap.get(fileName) : es6TestLibFileNameSourceFileMap.get(fileName); - } - else { - // Don't throw here -- the compiler might be looking for a test that actually doesn't exist as part of the TC - // Return if it is other library file, otherwise return undefined - return getDefaultLibrarySourceFile(fileName); - } - } - - const newLine = - newLineKind === ts.NewLineKind.CarriageReturnLineFeed ? carriageReturnLineFeed : - newLineKind === ts.NewLineKind.LineFeed ? lineFeed : - Harness.IO.newLine(); - - function toPath(fileName: string): ts.Path { - return ts.toPath(fileName, currentDirectory, getCanonicalFileName); - } - - return { - getCurrentDirectory: () => currentDirectory, - getSourceFile, - getDefaultLibFileName, - writeFile, - getCanonicalFileName, - useCaseSensitiveFileNames: () => useCaseSensitiveFileNames, - getNewLine: () => newLine, - fileExists: fileName => fileMap.has(toPath(fileName)), - readFile(fileName: string): string | undefined { - const file = fileMap.get(toPath(fileName)); - if (ts.endsWith(fileName, "json")) { - // strip comments - return file.getText(); - } - return file.text; - }, - realpath: (fileName: string): ts.Path => { - const path = toPath(fileName); - return (realPathMap.get(path) as ts.Path) || path; - }, - directoryExists: dir => { - let path = ts.toPath(dir, currentDirectory, getCanonicalFileName); - // Strip trailing /, which may exist if the path is a drive root - if (path[path.length - 1] === "/") { - path = path.substr(0, path.length - 1); - } - return mapHasFileInDirectory(path, fileMap); - }, - getDirectories: d => { - const path = ts.toPath(d, currentDirectory, getCanonicalFileName); - const result: string[] = []; - ts.forEachKey(fileMap, key => { - if (key.indexOf(path) === 0 && key.lastIndexOf("/") > path.length) { - let dirName = key.substr(path.length, key.indexOf("/", path.length + 1) - path.length); - if (dirName[0] === "/") { - dirName = dirName.substr(1); - } - if (result.indexOf(dirName) < 0) { - result.push(dirName); - } - } - }); - return result; - } - }; - } - - function mapHasFileInDirectory(directoryPath: ts.Path, map: ts.Map<{}>): boolean { - if (!map) { - return false; - } - let exists = false; - ts.forEachKey(map, fileName => { - if (!exists && ts.startsWith(fileName, directoryPath) && fileName[directoryPath.length] === "/") { - exists = true; - } - }); - return exists; - } - interface HarnessOptions { useCaseSensitiveFileNames?: boolean; includeBuiltFile?: string; diff --git a/src/harness/unittests/programMissingFiles.ts b/src/harness/unittests/programMissingFiles.ts index ce8abc232e746..6e0602998f0a8 100644 --- a/src/harness/unittests/programMissingFiles.ts +++ b/src/harness/unittests/programMissingFiles.ts @@ -1,4 +1,5 @@ /// +/// namespace ts { function verifyMissingFilePaths(missingPaths: ReadonlyArray, expected: ReadonlyArray) { @@ -39,15 +40,11 @@ namespace ts { "/// \n" // No extension }; - const testCompilerHost = Harness.Compiler.createCompilerHost( - /*inputFiles*/ [emptyFile, referenceFile], - /*writeFile*/ undefined, - /*scriptTarget*/ undefined, - /*useCaseSensitiveFileNames*/ false, - /*currentDirectory*/ "d:\\pretend\\", - /*newLineKind*/ NewLineKind.LineFeed, - /*libFiles*/ undefined - ); + const testCompilerHost = new compiler.CompilerHost( + vfs.VirtualFileSystem.createFromTestFiles( + { useCaseSensitiveFileNames: false, currentDirectory: "d:\\pretend\\" }, + [emptyFile, referenceFile]), + { newLine: NewLineKind.LineFeed }); it("handles no missing root files", () => { const program = createProgram([emptyFileRelativePath], options, testCompilerHost); diff --git a/src/harness/utils.ts b/src/harness/utils.ts index 79ab489304e5b..518a1be993fa4 100644 --- a/src/harness/utils.ts +++ b/src/harness/utils.ts @@ -1,4 +1,6 @@ namespace utils { + export function identity(v: T) { return v; } + export function getByteOrderMarkLength(text: string) { if (text.length >= 2) { const ch0 = text.charCodeAt(0); diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index 238cb65e05943..643b805a926a8 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -1373,7 +1373,7 @@ namespace vfs { } export interface VirtualFile { - // #region Event "contentChanged" + // #region Event "contentChanged" on(event: "contentChanged", listener: (entry: VirtualFile) => void): this; once(event: "contentChanged", listener: (entry: VirtualFile) => void): this; addListener(event: "contentChanged", listener: (entry: VirtualFile) => void): this; @@ -1385,7 +1385,7 @@ namespace vfs { } export interface VirtualFile { - // #region Untyped events + // #region Untyped events on(event: string | symbol, listener: (...args: any[]) => void): this; once(event: string | symbol, listener: (...args: any[]) => void): this; addListener(event: string | symbol, listener: (...args: any[]) => void): this; From 4697ba3e50223b1736fb0e5c1c19ca1e556725c5 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 9 Nov 2017 18:35:24 -0800 Subject: [PATCH 09/54] Add support for variations in module/target in compiler tests --- src/harness/collections.ts | 244 ----------- src/harness/compiler.ts | 70 ++- src/harness/compilerRunner.ts | 358 +++++++++------- src/harness/core.ts | 421 +++++++++++++++++++ src/harness/documents.ts | 66 +-- src/harness/events.ts | 4 + src/harness/harness.ts | 12 +- src/harness/tsconfig.json | 2 +- src/harness/unittests/programMissingFiles.ts | 2 +- src/harness/utils.ts | 25 +- src/harness/vfs.ts | 52 +-- src/harness/vpath.ts | 108 +++-- 12 files changed, 811 insertions(+), 553 deletions(-) delete mode 100644 src/harness/collections.ts create mode 100644 src/harness/core.ts diff --git a/src/harness/collections.ts b/src/harness/collections.ts deleted file mode 100644 index d311216a9151e..0000000000000 --- a/src/harness/collections.ts +++ /dev/null @@ -1,244 +0,0 @@ -/// -namespace collections { - // NOTE: Some of the functions here duplicate functionality from compiler/core.ts. They have been added - // to reduce the number of direct dependencies on compiler and services to eventually break away - // from depending directly on the compiler to speed up compilation time. - - import binarySearch = ts.binarySearch; - - function compareValues(a: string | number, b: string | number): number { - if (a === b) return 0; - if (a === undefined) return -1; - if (b === undefined) return +1; - return a < b ? -1 : +1; - } - - export function compareNumbers(a: number, b: number): number { - return compareValues(a, b); - } - - export function compareStrings(a: string, b: string, ignoreCase: boolean): number { - return ignoreCase - ? compareStringsCaseInsensitive(a, b) - : compareStringsCaseSensitive(a, b); - } - - export function compareStringsCaseSensitive(a: string, b: string): number { - return compareValues(a, b); - } - - export function compareStringsCaseInsensitive(a: string, b: string): number { - if (a === b) return 0; - if (a === undefined) return -1; - if (b === undefined) return +1; - a = a.toUpperCase(); - b = b.toUpperCase(); - return a < b ? -1 : a > b ? +1 : 0; - } - - export function equateStringsCaseSensitive(a: string, b: string): boolean { - return a === b; - } - - export function equateStringsCaseInsensitive(a: string, b: string): boolean { - return a === b - || a !== undefined - && b !== undefined - && a.toUpperCase() === b.toUpperCase(); - } - - function removeAt(array: T[], index: number): void { - for (let i = index; i < array.length - 1; i++) { - array[i] = array[i + 1]; - } - array.pop(); - } - - function insertAt(array: T[], index: number, value: T) { - if (index === 0) { - array.unshift(value); - } - else if (index === array.length) { - array.push(value); - } - else { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; - } - } - - /** - * A collection of key/value pairs internally sorted by key. - */ - export class KeyedCollection { - private _comparer: (a: K, b: K) => number; - private _keys: K[] = []; - private _values: V[] = []; - private _order: number[] = []; - private _version = 0; - private _copyOnWrite = false; - - constructor(comparer: (a: K, b: K) => number) { - this._comparer = comparer; - } - - public get size() { - return this._keys.length; - } - - public has(key: K) { - return binarySearch(this._keys, key, ts.identity, this._comparer) >= 0; - } - - public get(key: K) { - const index = binarySearch(this._keys, key, ts.identity, this._comparer); - return index >= 0 ? this._values[index] : undefined; - } - - public set(key: K, value: V) { - const index = binarySearch(this._keys, key, ts.identity, this._comparer); - if (index >= 0) { - this._values[index] = value; - } - else { - this.writePreamble(); - insertAt(this._keys, ~index, key); - insertAt(this._values, ~index, value); - insertAt(this._order, ~index, this._version); - this._version++; - } - return this; - } - - public delete(key: K) { - const index = binarySearch(this._keys, key, ts.identity, this._comparer); - if (index >= 0) { - this.writePreamble(); - removeAt(this._keys, index); - removeAt(this._values, index); - removeAt(this._order, index); - this._version++; - return true; - } - return false; - } - - public clear() { - if (this.size > 0) { - this.writePreamble(); - this._keys.length = 0; - this._values.length = 0; - this._order.length = 0; - this._version = 0; - } - } - - public forEach(callback: (value: V, key: K, collection: this) => void) { - const keys = this._keys; - const values = this._values; - const order = this.getInsertionOrder(); - const version = this._version; - this._copyOnWrite = true; - for (const index of order) { - callback(values[index], keys[index], this); - } - if (version === this._version) { - this._copyOnWrite = false; - } - } - - private writePreamble() { - if (this._copyOnWrite) { - this._keys = this._keys.slice(); - this._values = this._values.slice(); - this._order = this._order.slice(); - this._copyOnWrite = false; - } - } - - private getInsertionOrder() { - return this._order - .map((_, i) => i) - .sort((x, y) => compareNumbers(this._order[x], this._order[y])); - } - } - - const undefinedSentinel = {}; - - function escapeKey(text: string) { - return (text.length >= 2 && text.charAt(0) === "_" && text.charAt(1) === "_" ? "_" + text : text); - } - - function unescapeKey(text: string) { - return (text.length >= 3 && text.charAt(0) === "_" && text.charAt(1) === "_" && text.charAt(2) === "_" ? text.slice(1) : text); - } - - /** - * A collection of metadata that supports inheritance. - */ - export class Metadata { - private _parent: Metadata | undefined; - private _map: { [key: string]: any }; - private _version = 0; - private _size = -1; - private _parentVersion: number | undefined; - - constructor(parent?: Metadata) { - this._parent = parent; - this._map = Object.create(parent ? parent._map : null); // tslint:disable-line:no-null-keyword - } - - public get size(): number { - if (this._size === -1 || (this._parent && this._parent._version !== this._parentVersion)) { - let size = 0; - for (const _ in this._map) size++; - this._size = size; - if (this._parent) { - this._parentVersion = this._parent._version; - } - } - return this._size; - } - - public has(key: string): boolean { - return this._map[escapeKey(key)] !== undefined; - } - - public get(key: string): any { - const value = this._map[escapeKey(key)]; - return value === undefinedSentinel ? undefined : value; - } - - public set(key: string, value: any): this { - this._map[escapeKey(key)] = value === undefined ? undefinedSentinel : value; - this._size = -1; - this._version++; - return this; - } - - public delete(key: string): boolean { - const escapedKey = escapeKey(key); - if (this._map[escapedKey] !== undefined) { - delete this._map[escapedKey]; - this._size = -1; - this._version++; - return true; - } - return false; - } - - public clear(): void { - this._map = Object.create(this._parent ? this._parent._map : null); // tslint:disable-line:no-null-keyword - this._size = -1; - this._version++; - } - - public forEach(callback: (value: any, key: string, map: this) => void) { - for (const key in this._map) { - callback(this._map[key], unescapeKey(key), this); - } - } - } -} \ No newline at end of file diff --git a/src/harness/compiler.ts b/src/harness/compiler.ts index 6b4fcc62422c1..680f1f6097840 100644 --- a/src/harness/compiler.ts +++ b/src/harness/compiler.ts @@ -1,32 +1,30 @@ /// /// -/// +/// /// /// /// -namespace compiler { - import TextDocument = documents.TextDocument; - import SourceMap = documents.SourceMap; - import KeyedCollection = collections.KeyedCollection; - import VirtualFileSystem = vfs.VirtualFileSystem; +// NOTE: The contents of this file are all exported from the namespace 'compiler'. This is to +// support the eventual conversion of harness into a modular system. +namespace compiler { export class CompilerHost { public readonly vfs: vfs.VirtualFileSystem; public readonly defaultLibLocation: string; - public readonly outputs: TextDocument[] = []; + public readonly outputs: documents.TextDocument[] = []; public readonly traces: string[] = []; public readonly shouldAssertInvariants = !Harness.lightMode; private _setParentNodes: boolean; - private _sourceFiles: KeyedCollection; + private _sourceFiles: core.KeyedCollection; private _newLine: string; private _parseConfigHost: ParseConfigHost; - constructor(vfs: VirtualFileSystem, options: ts.CompilerOptions, setParentNodes = false) { + constructor(vfs: vfs.VirtualFileSystem, options: ts.CompilerOptions, setParentNodes = false) { this.vfs = vfs; this.defaultLibLocation = vfs.metadata.get("defaultLibLocation") || ""; - this._sourceFiles = new KeyedCollection(this.vfs.pathComparer); + this._sourceFiles = new core.KeyedCollection(this.vfs.pathComparer); this._newLine = options.newLine === ts.NewLineKind.LineFeed ? "\n" : "\r\n"; this._setParentNodes = setParentNodes; } @@ -66,7 +64,7 @@ namespace compiler { public readFile(path: string): string | undefined { const entry = this.vfs.getFile(path); - const content = entry && entry.content && utils.removeByteOrderMark(entry.content); + const content = entry && entry.content && core.removeByteOrderMark(entry.content); return content === undefined ? undefined : vpath.extname(path) === ".json" ? utils.removeComments(content, utils.CommentRemoval.leadingAndTrailing) : content; @@ -77,7 +75,7 @@ namespace compiler { if (writeByteOrderMark) content = "\u00EF\u00BB\u00BF" + content; const entry = this.vfs.addFile(fileName, content, { overwrite: true }); if (entry) { - const document = new TextDocument(fileName, content); + const document = new documents.TextDocument(fileName, content); document.meta.set("fileName", fileName); entry.metadata.set("document", document); const index = this.outputs.findIndex(output => this.vfs.pathComparer(document.file, output.file) === 0); @@ -115,7 +113,7 @@ namespace compiler { if (file) { let content = file.content; if (content !== undefined) { - content = utils.removeByteOrderMark(content); + content = core.removeByteOrderMark(content); // We cache and reuse source files for files we know shouldn't change. const shouldCache = vpath.isDefaultLibrary(fileName) || @@ -153,9 +151,9 @@ namespace compiler { } export class ParseConfigHost { - public readonly vfs: VirtualFileSystem; + public readonly vfs: vfs.VirtualFileSystem; - constructor(vfs: VirtualFileSystem) { + constructor(vfs: vfs.VirtualFileSystem) { this.vfs = vfs; } @@ -218,10 +216,10 @@ namespace compiler { } export interface CompilationOutput { - readonly input: TextDocument; - readonly js: TextDocument | undefined; - readonly dts: TextDocument | undefined; - readonly map: TextDocument | undefined; + readonly input: documents.TextDocument; + readonly js: documents.TextDocument | undefined; + readonly dts: documents.TextDocument | undefined; + readonly map: documents.TextDocument | undefined; } export class CompilationResult { @@ -230,12 +228,12 @@ namespace compiler { public readonly result: ts.EmitResult | undefined; public readonly options: ts.CompilerOptions; public readonly diagnostics: ts.Diagnostic[]; - public readonly js: KeyedCollection; - public readonly dts: KeyedCollection; - public readonly maps: KeyedCollection; + public readonly js: core.KeyedCollection; + public readonly dts: core.KeyedCollection; + public readonly maps: core.KeyedCollection; - private _inputs: TextDocument[] = []; - private _inputsAndOutputs: KeyedCollection; + private _inputs: documents.TextDocument[] = []; + private _inputsAndOutputs: core.KeyedCollection; constructor(host: CompilerHost, options: ts.CompilerOptions, program: ts.Program | undefined, result: ts.EmitResult | undefined, diagnostics: ts.Diagnostic[]) { this.host = host; @@ -245,9 +243,9 @@ namespace compiler { this.options = program ? program.getCompilerOptions() : options; // collect outputs - this.js = new KeyedCollection(this.vfs.pathComparer); - this.dts = new KeyedCollection(this.vfs.pathComparer); - this.maps = new KeyedCollection(this.vfs.pathComparer); + this.js = new core.KeyedCollection(this.vfs.pathComparer); + this.dts = new core.KeyedCollection(this.vfs.pathComparer); + this.maps = new core.KeyedCollection(this.vfs.pathComparer); for (const document of this.host.outputs) { if (vpath.isJavaScript(document.file)) { this.js.set(document.file, document); @@ -261,11 +259,11 @@ namespace compiler { } // correlate inputs and outputs - this._inputsAndOutputs = new KeyedCollection(this.vfs.pathComparer); + this._inputsAndOutputs = new core.KeyedCollection(this.vfs.pathComparer); if (program) { for (const sourceFile of program.getSourceFiles()) { if (sourceFile) { - const input = new TextDocument(sourceFile.fileName, sourceFile.text); + const input = new documents.TextDocument(sourceFile.fileName, sourceFile.text); this._inputs.push(input); if (!vpath.isDeclaration(sourceFile.fileName)) { const outputs = { @@ -289,11 +287,11 @@ namespace compiler { return this.host.vfs; } - public get inputs(): ReadonlyArray { + public get inputs(): ReadonlyArray { return this._inputs; } - public get outputs(): ReadonlyArray { + public get outputs(): ReadonlyArray { return this.host.outputs; } @@ -318,25 +316,25 @@ namespace compiler { return this._inputsAndOutputs.get(vpath.resolve(this.vfs.currentDirectory, path)); } - public getInput(path: string): TextDocument | undefined { + public getInput(path: string): documents.TextDocument | undefined { const outputs = this.getInputsAndOutputs(path); return outputs && outputs.input; } - public getOutput(path: string, kind: "js" | "dts" | "map"): TextDocument | undefined { + public getOutput(path: string, kind: "js" | "dts" | "map"): documents.TextDocument | undefined { const outputs = this.getInputsAndOutputs(path); return outputs && outputs[kind]; } - public getSourceMap(path: string): SourceMap | undefined { + public getSourceMap(path: string): documents.SourceMap | undefined { if (this.options.noEmit || vpath.isDeclaration(path)) return undefined; if (this.options.inlineSourceMap) { const document = this.getOutput(path, "js"); - return document && SourceMap.fromSource(document.text); + return document && documents.SourceMap.fromSource(document.text); } if (this.options.sourceMap) { const document = this.getOutput(path, "map"); - return document && new SourceMap(document.file, document.text); + return document && new documents.SourceMap(document.file, document.text); } } diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 7aa26b9c8cd83..5eb78f746dff4 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -45,185 +45,241 @@ class CompilerBaselineRunner extends RunnerBase { return this.enumerateFiles(this.basePath, /\.tsx?$/, { recursive: true }); } - private makeUnitName(name: string, root: string) { - const path = ts.toPath(name, root, utils.identity); - const pathStart = ts.toPath(Harness.IO.getCurrentDirectory(), "", utils.identity); - return pathStart ? path.replace(pathStart, "/") : path; + public initializeTests() { + describe(this.testSuiteName + " tests", () => { + describe("Setup compiler for compiler baselines", () => { + this.parseOptions(); + }); + + // this will set up a series of describe/it blocks to run between the setup and cleanup phases + const files = this.tests.length > 0 ? this.tests : this.enumerateTestFiles(); + files.forEach(file => { this.checkTestCodeOutput(vpath.normalizeSeparators(file)); }); + }); } public checkTestCodeOutput(fileName: string) { - describe(`${this.testSuiteName} tests for ${fileName}`, () => { - // Mocha holds onto the closure environment of the describe callback even after the test is done. - // Everything declared here should be cleared out in the "after" callback. - let justName: string; - let lastUnit: Harness.TestCaseParser.TestUnitData; - let harnessSettings: Harness.TestCaseParser.CompilerSettings; - let hasNonDtsFiles: boolean; - - let result: Harness.Compiler.CompilerResult; - let options: ts.CompilerOptions; - let tsConfigFiles: Harness.Compiler.TestFile[]; - // equivalent to the files that will be passed on the command line - let toBeCompiled: Harness.Compiler.TestFile[]; - // equivalent to other files on the file system not directly passed to the compiler (ie things that are referenced by other files) - let otherFiles: Harness.Compiler.TestFile[]; - - before(() => { - justName = vpath.basename(fileName); - const content = Harness.IO.readFile(fileName); - const rootDir = fileName.indexOf("conformance") === -1 ? "tests/cases/compiler/" : ts.getDirectoryPath(fileName) + "/"; - const testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName, rootDir); - const units = testCaseContent.testUnitData; - harnessSettings = testCaseContent.settings; - let tsConfigOptions: ts.CompilerOptions; - tsConfigFiles = []; - if (testCaseContent.tsConfig) { - assert.equal(testCaseContent.tsConfig.fileNames.length, 0, `list of files in tsconfig is not currently supported`); - - tsConfigOptions = ts.cloneCompilerOptions(testCaseContent.tsConfig.options); - tsConfigFiles.push(this.createHarnessTestFile(testCaseContent.tsConfigFileUnitData, rootDir, ts.combinePaths(rootDir, tsConfigOptions.configFilePath))); - } - else { - const baseUrl = harnessSettings.baseUrl; - if (baseUrl !== undefined && !ts.isRootedDiskPath(baseUrl)) { - harnessSettings.baseUrl = ts.getNormalizedAbsolutePath(baseUrl, rootDir); - } - } + for (const { name, payload } of CompilerTest.getConfigurations(fileName)) { + describe(`${this.testSuiteName} tests for ${fileName}${name ? ` (${name})` : ``}`, () => { + this.runSuite(fileName, payload); + }); + } + } - lastUnit = units[units.length - 1]; - hasNonDtsFiles = ts.forEach(units, unit => !ts.fileExtensionIs(unit.name, ts.Extension.Dts)); - // We need to assemble the list of input files for the compiler and other related files on the 'filesystem' (ie in a multi-file test) - // If the last file in a test uses require or a triple slash reference we'll assume all other files will be brought in via references, - // otherwise, assume all files are just meant to be in the same compilation session without explicit references to one another. - toBeCompiled = []; - otherFiles = []; - - if (testCaseContent.settings.noImplicitReferences || /require\(/.test(lastUnit.content) || /reference\spath/.test(lastUnit.content)) { - toBeCompiled.push(this.createHarnessTestFile(lastUnit, rootDir)); - units.forEach(unit => { - if (unit.name !== lastUnit.name) { - otherFiles.push(this.createHarnessTestFile(unit, rootDir)); - } - }); - } - else { - toBeCompiled = units.map(unit => { - return this.createHarnessTestFile(unit, rootDir); - }); - } + private runSuite(fileName: string, testCaseContent: Harness.TestCaseParser.TestCaseContent) { + // Mocha holds onto the closure environment of the describe callback even after the test is done. + // Everything declared here should be cleared out in the "after" callback. + let compilerTest: CompilerTest | undefined; + before(() => { compilerTest = new CompilerTest(fileName, testCaseContent); }); + it(`Correct errors for ${fileName}`, () => { compilerTest.verifyDiagnostics(); }); + it(`Correct module resolution tracing for ${fileName}`, () => { compilerTest.verifyModuleResolution(); }); + it(`Correct sourcemap content for ${fileName}`, () => { compilerTest.verifySourceMapRecord(); }); + it(`Correct JS output for ${fileName}`, () => { if (this.emit) compilerTest.verifyJavaScriptOutput(); }); + it(`Correct Sourcemap output for ${fileName}`, () => { compilerTest.verifySourceMapOutput(); }); + it(`Correct type/symbol baselines for ${fileName}`, () => { compilerTest.verifyTypesAndSymbols(); }); + after(() => { compilerTest = undefined; }); + } - if (tsConfigOptions && tsConfigOptions.configFilePath !== undefined) { - tsConfigOptions.configFilePath = ts.combinePaths(rootDir, tsConfigOptions.configFilePath); - tsConfigOptions.configFile.fileName = tsConfigOptions.configFilePath; + private parseOptions() { + if (this.options && this.options.length > 0) { + this.emit = false; + + const opts = this.options.split(","); + for (const opt of opts) { + switch (opt) { + case "emit": + this.emit = true; + break; + default: + throw new Error("unsupported flag"); } + } + } + } +} - const output = Harness.Compiler.compileFiles( - toBeCompiled, otherFiles, harnessSettings, /*options*/ tsConfigOptions, /*currentDirectory*/ harnessSettings.currentDirectory); +interface CompilerTestConfiguration { + name: string; + payload: Harness.TestCaseParser.TestCaseContent; +} - options = output.options; - result = output.result; - }); +class CompilerTest { + private fileName: string; + private justName: string; + private lastUnit: Harness.TestCaseParser.TestUnitData; + private harnessSettings: Harness.TestCaseParser.CompilerSettings; + private hasNonDtsFiles: boolean; + private result: Harness.Compiler.CompilerResult; + private options: ts.CompilerOptions; + private tsConfigFiles: Harness.Compiler.TestFile[]; + // equivalent to the files that will be passed on the command line + private toBeCompiled: Harness.Compiler.TestFile[]; + // equivalent to other files on the file system not directly passed to the compiler (ie things that are referenced by other files) + private otherFiles: Harness.Compiler.TestFile[]; - after(() => { - // Mocha holds onto the closure environment of the describe callback even after the test is done. - // Therefore we have to clean out large objects after the test is done. - justName = undefined; - lastUnit = undefined; - hasNonDtsFiles = undefined; - result = undefined; - options = undefined; - toBeCompiled = undefined; - otherFiles = undefined; - tsConfigFiles = undefined; - }); + constructor(fileName: string, testCaseContent: Harness.TestCaseParser.TestCaseContent) { + this.fileName = fileName; + this.justName = vpath.basename(fileName); + const rootDir = fileName.indexOf("conformance") === -1 ? "tests/cases/compiler/" : ts.getDirectoryPath(fileName) + "/"; + const units = testCaseContent.testUnitData; + this.harnessSettings = testCaseContent.settings; + let tsConfigOptions: ts.CompilerOptions; + this.tsConfigFiles = []; + if (testCaseContent.tsConfig) { + assert.equal(testCaseContent.tsConfig.fileNames.length, 0, `list of files in tsconfig is not currently supported`); - // check errors - it("Correct errors for " + fileName, () => { - Harness.Compiler.doErrorBaseline(justName, tsConfigFiles.concat(toBeCompiled, otherFiles), result.errors, !!options.pretty); - }); + tsConfigOptions = ts.cloneCompilerOptions(testCaseContent.tsConfig.options); + this.tsConfigFiles.push(this.createHarnessTestFile(testCaseContent.tsConfigFileUnitData, rootDir, ts.combinePaths(rootDir, tsConfigOptions.configFilePath))); + } + else { + const baseUrl = this.harnessSettings.baseUrl; + if (baseUrl !== undefined && !ts.isRootedDiskPath(baseUrl)) { + this.harnessSettings.baseUrl = ts.getNormalizedAbsolutePath(baseUrl, rootDir); + } + } - it (`Correct module resolution tracing for ${fileName}`, () => { - if (options.traceResolution) { - Harness.Baseline.runBaseline(justName.replace(/\.tsx?$/, ".trace.json"), () => { - return utils.removeTestPathPrefixes(JSON.stringify(result.traceResults || [], undefined, 4)); - }); - } - }); + this.lastUnit = units[units.length - 1]; + this.hasNonDtsFiles = ts.forEach(units, unit => !ts.fileExtensionIs(unit.name, ts.Extension.Dts)); + // We need to assemble the list of input files for the compiler and other related files on the 'filesystem' (ie in a multi-file test) + // If the last file in a test uses require or a triple slash reference we'll assume all other files will be brought in via references, + // otherwise, assume all files are just meant to be in the same compilation session without explicit references to one another. + this.toBeCompiled = []; + this.otherFiles = []; - // Source maps? - it("Correct sourcemap content for " + fileName, () => { - if (options.sourceMap || options.inlineSourceMap) { - Harness.Baseline.runBaseline(justName.replace(/\.tsx?$/, ".sourcemap.txt"), () => { - const record = utils.removeTestPathPrefixes(result.getSourceMapRecord()); - if ((options.noEmitOnError && result.errors.length !== 0) || record === undefined) { - // Because of the noEmitOnError option no files are created. We need to return null because baselining isn't required. - /* tslint:disable:no-null-keyword */ - return null; - /* tslint:enable:no-null-keyword */ - } - return record; - }); + if (testCaseContent.settings.noImplicitReferences || /require\(/.test(this.lastUnit.content) || /reference\spath/.test(this.lastUnit.content)) { + this.toBeCompiled.push(this.createHarnessTestFile(this.lastUnit, rootDir)); + units.forEach(unit => { + if (unit.name !== this.lastUnit.name) { + this.otherFiles.push(this.createHarnessTestFile(unit, rootDir)); } }); - - it("Correct JS output for " + fileName, () => { - if (hasNonDtsFiles && this.emit) { - Harness.Compiler.doJsEmitBaseline(justName, fileName, options, result, tsConfigFiles, toBeCompiled, otherFiles, harnessSettings); - } + } + else { + this.toBeCompiled = units.map(unit => { + return this.createHarnessTestFile(unit, rootDir); }); + } - it("Correct Sourcemap output for " + fileName, () => { - Harness.Compiler.doSourcemapBaseline(justName, options, result, harnessSettings); - }); + if (tsConfigOptions && tsConfigOptions.configFilePath !== undefined) { + tsConfigOptions.configFilePath = ts.combinePaths(rootDir, tsConfigOptions.configFilePath); + tsConfigOptions.configFile.fileName = tsConfigOptions.configFilePath; + } + + const output = Harness.Compiler.compileFiles( + this.toBeCompiled, + this.otherFiles, + this.harnessSettings, + /*options*/ tsConfigOptions, + /*currentDirectory*/ this.harnessSettings.currentDirectory); - it("Correct type/symbol baselines for " + fileName, () => { - if (fileName.indexOf("APISample") >= 0) { - return; + this.options = output.options; + this.result = output.result; + } + + public static getConfigurations(fileName: string) { + const content = Harness.IO.readFile(fileName); + const rootDir = fileName.indexOf("conformance") === -1 ? "tests/cases/compiler/" : ts.getDirectoryPath(fileName) + "/"; + const testCaseContent = Harness.TestCaseParser.makeUnitsFromTest(content, fileName, rootDir); + const configurations: CompilerTestConfiguration[] = []; + const scriptTargets = this._split(testCaseContent.settings.target); + const moduleKinds = this._split(testCaseContent.settings.module); + for (const scriptTarget of scriptTargets) { + for (const moduleKind of moduleKinds) { + let name = ""; + if (moduleKinds.length > 1) { + name += `@module: ${moduleKind || "none"}`; + } + if (scriptTargets.length > 1) { + if (name) name += ", "; + name += `@target: ${scriptTarget || "none"}`; } - Harness.Compiler.doTypeAndSymbolBaseline(justName, result.program, toBeCompiled.concat(otherFiles).filter(file => !!result.program.getSourceFile(file.unitName))); - }); - }); + const settings = { ...testCaseContent.settings }; + if (scriptTarget) settings.target = scriptTarget; + if (moduleKind) settings.module = moduleKind; + configurations.push({ name, payload: { ...testCaseContent, settings } }); + } + } + + return configurations; } - private createHarnessTestFile(lastUnit: Harness.TestCaseParser.TestUnitData, rootDir: string, unitName?: string): Harness.Compiler.TestFile { - return { unitName: unitName || this.makeUnitName(lastUnit.name, rootDir), content: lastUnit.content, fileOptions: lastUnit.fileOptions }; + public verifyDiagnostics() { + // check errors + Harness.Compiler.doErrorBaseline( + this.justName, + this.tsConfigFiles.concat(this.toBeCompiled, this.otherFiles), + this.result.errors, + !!this.options.pretty); } - public initializeTests() { - describe(this.testSuiteName + " tests", () => { - describe("Setup compiler for compiler baselines", () => { - this.parseOptions(); + public verifyModuleResolution() { + if (this.options.traceResolution) { + Harness.Baseline.runBaseline(this.justName.replace(/\.tsx?$/, ".trace.json"), () => { + return utils.removeTestPathPrefixes(JSON.stringify(this.result.traceResults || [], undefined, 4)); }); + } + } - // this will set up a series of describe/it blocks to run between the setup and cleanup phases - if (this.tests.length === 0) { - const testFiles = this.enumerateTestFiles(); - testFiles.forEach(fn => { - fn = fn.replace(/\\/g, "/"); - this.checkTestCodeOutput(fn); - }); - } - else { - this.tests.forEach(test => this.checkTestCodeOutput(test)); - } - }); + public verifySourceMapRecord() { + if (this.options.sourceMap || this.options.inlineSourceMap) { + Harness.Baseline.runBaseline(this.justName.replace(/\.tsx?$/, ".sourcemap.txt"), () => { + const record = utils.removeTestPathPrefixes(this.result.getSourceMapRecord()); + if ((this.options.noEmitOnError && this.result.errors.length !== 0) || record === undefined) { + // Because of the noEmitOnError option no files are created. We need to return null because baselining isn't required. + /* tslint:disable:no-null-keyword */ + return null; + /* tslint:enable:no-null-keyword */ + } + return record; + }); + } } - private parseOptions() { - if (this.options && this.options.length > 0) { - this.emit = false; + public verifyJavaScriptOutput() { + if (this.hasNonDtsFiles) { + Harness.Compiler.doJsEmitBaseline( + this.justName, + this.fileName, + this.options, + this.result, + this.tsConfigFiles, + this.toBeCompiled, + this.otherFiles, + this.harnessSettings); + } + } - const opts = this.options.split(","); - for (const opt of opts) { - switch (opt) { - case "emit": - this.emit = true; - break; - default: - throw new Error("unsupported flag"); - } - } + public verifySourceMapOutput() { + Harness.Compiler.doSourcemapBaseline( + this.justName, + this.options, + this.result, + this.harnessSettings); + } + + public verifyTypesAndSymbols() { + if (this.fileName.indexOf("APISample") >= 0) { + return; } + + Harness.Compiler.doTypeAndSymbolBaseline( + this.justName, + this.result.program, + this.toBeCompiled.concat(this.otherFiles).filter(file => !!this.result.program.getSourceFile(file.unitName))); + } + + private static _split(text: string) { + const entries = text && text.split(",").map(s => s.toLowerCase().trim()).filter(s => s.length > 0); + return entries && entries.length > 0 ? entries : [""]; + } + + private makeUnitName(name: string, root: string) { + const path = ts.toPath(name, root, core.identity); + const pathStart = ts.toPath(Harness.IO.getCurrentDirectory(), "", core.identity); + return pathStart ? path.replace(pathStart, "/") : path; + } + + private createHarnessTestFile(lastUnit: Harness.TestCaseParser.TestUnitData, rootDir: string, unitName?: string): Harness.Compiler.TestFile { + return { unitName: unitName || this.makeUnitName(lastUnit.name, rootDir), content: lastUnit.content, fileOptions: lastUnit.fileOptions }; } } \ No newline at end of file diff --git a/src/harness/core.ts b/src/harness/core.ts new file mode 100644 index 0000000000000..9efe53c4d8a77 --- /dev/null +++ b/src/harness/core.ts @@ -0,0 +1,421 @@ +/// + +// NOTE: The contents of this file are all exported from the namespace 'core'. This is to +// support the eventual conversion of harness into a modular system. + +// NOTE: Some of the functions here duplicate functionality from compiler/core.ts. They have been added +// to reduce the number of direct dependencies on compiler and services to eventually break away +// from depending directly on the compiler to speed up compilation time. + +namespace core { + export function identity(v: T): T { return v; } + + // + // Comparers + // + + export type Comparer = (x: T, y: T) => number; + export type EqualityComparer = (x: T, y: T) => boolean; + + export function compareNumbers(a: number, b: number): number { + if (a === b) return 0; + if (a === undefined) return -1; + if (b === undefined) return +1; + return a < b ? -1 : +1; + } + + export function compareStrings(a: string, b: string, ignoreCase: boolean): number { + return ignoreCase + ? compareStringsCaseInsensitive(a, b) + : compareStringsCaseSensitive(a, b); + } + + // NOTE: This is a duplicate of `compareNumbers` above, but is intended to be used only with + // strings to reduce polymorphism. + export function compareStringsCaseSensitive(a: string, b: string): number { + if (a === b) return 0; + if (a === undefined) return -1; + if (b === undefined) return +1; + return a < b ? -1 : +1; + } + + export function compareStringsCaseInsensitive(a: string, b: string): number { + if (a === b) return 0; + if (a === undefined) return -1; + if (b === undefined) return +1; + a = a.toUpperCase(); + b = b.toUpperCase(); + return a < b ? -1 : a > b ? +1 : 0; + } + + export function equateStringsCaseSensitive(a: string, b: string): boolean { + return a === b; + } + + export function equateStringsCaseInsensitive(a: string, b: string): boolean { + return a === b + || a !== undefined + && b !== undefined + && a.toUpperCase() === b.toUpperCase(); + } + + // + // Collections + // + + /** + * A collection of key/value pairs internally sorted by key. + */ + export class KeyedCollection { + private _comparer: (a: K, b: K) => number; + private _keys: K[] = []; + private _values: V[] = []; + private _order: number[] = []; + private _version = 0; + private _copyOnWrite = false; + + constructor(comparer: (a: K, b: K) => number) { + this._comparer = comparer; + } + + public get size() { + return this._keys.length; + } + + public has(key: K) { + return binarySearch(this._keys, key, identity, this._comparer) >= 0; + } + + public get(key: K) { + const index = binarySearch(this._keys, key, identity, this._comparer); + return index >= 0 ? this._values[index] : undefined; + } + + public set(key: K, value: V) { + const index = binarySearch(this._keys, key, identity, this._comparer); + if (index >= 0) { + this._values[index] = value; + } + else { + this.writePreamble(); + insertAt(this._keys, ~index, key); + insertAt(this._values, ~index, value); + insertAt(this._order, ~index, this._version); + this._version++; + } + return this; + } + + public delete(key: K) { + const index = binarySearch(this._keys, key, identity, this._comparer); + if (index >= 0) { + this.writePreamble(); + removeAt(this._keys, index); + removeAt(this._values, index); + removeAt(this._order, index); + this._version++; + return true; + } + return false; + } + + public clear() { + if (this.size > 0) { + this.writePreamble(); + this._keys.length = 0; + this._values.length = 0; + this._order.length = 0; + this._version = 0; + } + } + + public forEach(callback: (value: V, key: K, collection: this) => void) { + const keys = this._keys; + const values = this._values; + const order = this.getInsertionOrder(); + const version = this._version; + this._copyOnWrite = true; + for (const index of order) { + callback(values[index], keys[index], this); + } + if (version === this._version) { + this._copyOnWrite = false; + } + } + + private writePreamble() { + if (this._copyOnWrite) { + this._keys = this._keys.slice(); + this._values = this._values.slice(); + this._order = this._order.slice(); + this._copyOnWrite = false; + } + } + + private getInsertionOrder() { + return this._order + .map((_, i) => i) + .sort((x, y) => compareNumbers(this._order[x], this._order[y])); + } + } + + /** + * A collection of metadata that supports inheritance. + */ + export class Metadata { + private static readonly _undefinedValue = {}; + private _parent: Metadata | undefined; + private _map: { [key: string]: any }; + private _version = 0; + private _size = -1; + private _parentVersion: number | undefined; + + constructor(parent?: Metadata) { + this._parent = parent; + this._map = Object.create(parent ? parent._map : null); // tslint:disable-line:no-null-keyword + } + + public get size(): number { + if (this._size === -1 || (this._parent && this._parent._version !== this._parentVersion)) { + let size = 0; + for (const _ in this._map) size++; + this._size = size; + if (this._parent) { + this._parentVersion = this._parent._version; + } + } + return this._size; + } + + public has(key: string): boolean { + return this._map[Metadata._escapeKey(key)] !== undefined; + } + + public get(key: string): any { + const value = this._map[Metadata._escapeKey(key)]; + return value === Metadata._undefinedValue ? undefined : value; + } + + public set(key: string, value: any): this { + this._map[Metadata._escapeKey(key)] = value === undefined ? Metadata._undefinedValue : value; + this._size = -1; + this._version++; + return this; + } + + public delete(key: string): boolean { + const escapedKey = Metadata._escapeKey(key); + if (this._map[escapedKey] !== undefined) { + delete this._map[escapedKey]; + this._size = -1; + this._version++; + return true; + } + return false; + } + + public clear(): void { + this._map = Object.create(this._parent ? this._parent._map : null); // tslint:disable-line:no-null-keyword + this._size = -1; + this._version++; + } + + public forEach(callback: (value: any, key: string, map: this) => void) { + for (const key in this._map) { + callback(this._map[key], Metadata._unescapeKey(key), this); + } + } + + private static _escapeKey(text: string) { + return (text.length >= 2 && text.charAt(0) === "_" && text.charAt(1) === "_" ? "_" + text : text); + } + + private static _unescapeKey(text: string) { + return (text.length >= 3 && text.charAt(0) === "_" && text.charAt(1) === "_" && text.charAt(2) === "_" ? text.slice(1) : text); + } + } + + export function binarySearch(array: ReadonlyArray, value: T, keySelector: (v: T) => U, keyComparer: Comparer, offset?: number): number { + if (!array || array.length === 0) { + return -1; + } + + let low = offset || 0; + let high = array.length - 1; + const key = keySelector(value); + while (low <= high) { + const middle = low + ((high - low) >> 1); + const midKey = keySelector(array[middle]); + const result = keyComparer(midKey, key); + if (result < 0) { + low = middle + 1; + } + else if (result > 0) { + high = middle - 1; + } + else { + return middle; + } + } + + return ~low; + } + + export function removeAt(array: T[], index: number): void { + for (let i = index; i < array.length - 1; i++) { + array[i] = array[i + 1]; + } + + array.length--; + } + + export function insertAt(array: T[], index: number, value: T): void { + if (index === 0) { + array.unshift(value); + } + else if (index === array.length) { + array.push(value); + } + else { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; + } + } + + export function stableSort(array: T[], comparer: (x: T, y: T) => number): T[] { + return array + .map((_, i) => i) // create array of indices + .sort((x, y) => comparer(array[x], array[y]) || x - y) // sort indices by value then position + .map(i => array[i]); // get sorted array + } + + // + // Strings + // + + export function padLeft(text: string, size: number, ch = " "): string { + while (text.length < size) text = ch + text; + return text; + } + + export function padRight(text: string, size: number, ch = " "): string { + while (text.length < size) text += ch; + return text; + } + + export function getByteOrderMarkLength(text: string): number { + if (text.length >= 2) { + const ch0 = text.charCodeAt(0); + const ch1 = text.charCodeAt(1); + if ((ch0 === 0xff && ch1 === 0xfe) || + (ch0 === 0xfe && ch1 === 0xff)) { + return 2; + } + if (text.length >= 3 && ch0 === 0xef && ch1 === 0xbb && text.charCodeAt(2) === 0xbf) { + return 3; + } + } + return 0; + } + + export function removeByteOrderMark(text: string): string { + const length = getByteOrderMarkLength(text); + return length ? text.slice(length) : text; + } + + function splitLinesWorker(text: string, lineStarts: number[] | undefined, lines: string[] | undefined, removeEmptyElements: boolean) { + let pos = 0; + let end = 0; + let lineStart = 0; + let nonWhiteSpace = false; + while (pos < text.length) { + const ch = text.charCodeAt(pos); + end = pos; + pos++; + switch (ch) { + // LineTerminator + case 0x000d: // carriage return + if (pos < text.length && text.charCodeAt(pos) === 0x000a) { + pos++; + } + // falls through + + case 0x000a: // line feed + case 0x2028: // line separator + case 0x2029: // paragraph separator + if (lineStarts) { + lineStarts.push(lineStart); + } + if (lines && (!removeEmptyElements || nonWhiteSpace)) { + lines.push(text.slice(lineStart, end)); + } + lineStart = pos; + nonWhiteSpace = false; + break; + + // WhiteSpace + case 0x0009: // tab + case 0x000b: // vertical tab + case 0x000c: // form feed + case 0x0020: // space + case 0x00a0: // no-break space + case 0xfeff: // zero width no-break space + case 0x1680: // ogham space mark + case 0x2000: // en quad + case 0x2001: // em quad + case 0x2002: // en space + case 0x2003: // em space + case 0x2004: // three-per-em space + case 0x2005: // four-per-em space + case 0x2006: // six-per-em space + case 0x2007: // figure space + case 0x2008: // punctuation space + case 0x2009: // thin space + case 0x200a: // hair space + case 0x202f: // narrow no-break space + case 0x205f: // medium mathematical space + case 0x3000: // ideographic space + case 0x0085: // next-line (not strictly per spec, but used by the compiler) + break; + + default: + nonWhiteSpace = true; + break; + } + } + if (lineStarts) { + lineStarts.push(lineStart); + } + if (lines && (!removeEmptyElements || nonWhiteSpace)) { + lines.push(text.slice(lineStart, text.length)); + } + } + + export type LineStarts = ReadonlyArray; + + export interface LinesAndLineStarts { + readonly lines: ReadonlyArray; + readonly lineStarts: LineStarts; + } + + export function getLinesAndLineStarts(text: string): LinesAndLineStarts { + const lines: string[] = []; + const lineStarts: number[] = []; + splitLinesWorker(text, lineStarts, lines, /*removeEmptyElements*/ false); + return { lines, lineStarts }; + } + + export function splitLines(text: string, removeEmptyElements = false): string[] { + const lines: string[] = []; + splitLinesWorker(text, /*lineStarts*/ undefined, lines, removeEmptyElements); + return lines; + } + + export function computeLineStarts(text: string): LineStarts { + const lineStarts: number[] = []; + splitLinesWorker(text, lineStarts, /*lines*/ undefined, /*removeEmptyElements*/ false); + return lineStarts; + } +} \ No newline at end of file diff --git a/src/harness/documents.ts b/src/harness/documents.ts index b460cc8393f07..a5df3a6af5258 100644 --- a/src/harness/documents.ts +++ b/src/harness/documents.ts @@ -1,4 +1,7 @@ -/// +/// + +// NOTE: The contents of this file are all exported from the namespace 'documents'. This is to +// support the eventual conversion of harness into a modular system. namespace documents { export class TextDocument { @@ -6,16 +9,16 @@ namespace documents { public readonly file: string; public readonly text: string; - private _lineStarts: number[] | undefined; + private _lineStarts: core.LineStarts | undefined; - constructor(file: string, content: string, meta?: Map) { + constructor(file: string, text: string, meta?: Map) { this.file = file; - this.text = content; + this.text = text; this.meta = meta || new Map(); } - public get lineStarts(): number[] { - return this._lineStarts || (this._lineStarts = ts.computeLineStarts(this.text)); + public get lineStarts(): core.LineStarts { + return this._lineStarts || (this._lineStarts = core.computeLineStarts(this.text)); } } @@ -39,10 +42,6 @@ namespace documents { nameIndex?: number; } - const mappingRegExp = /([A-Za-z0-9+/]+),?|(;)|./g; - const sourceMappingURLRegExp = /^\/\/[#@]\s*sourceMappingURL\s*=\s*(.*?)\s*$/mig; - const dataURLRegExp = /^data:application\/json;base64,([a-z0-9+/=]+)$/i; - export class SourceMap { public readonly raw: RawSourceMap; public readonly mapFile: string | undefined; @@ -54,6 +53,11 @@ namespace documents { public readonly mappings: ReadonlyArray = []; public readonly names: ReadonlyArray | undefined; + private static readonly _mappingRegExp = /([A-Za-z0-9+/]+),?|(;)|./g; + private static readonly _sourceMappingURLRegExp = /^\/\/[#@]\s*sourceMappingURL\s*=\s*(.*?)\s*$/mig; + private static readonly _dataURLRegExp = /^data:application\/json;base64,([a-z0-9+/=]+)$/i; + private static readonly _base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + private _emittedLineMappings: Mapping[][] = []; private _sourceLineMappings: Mapping[][][] = []; @@ -76,9 +80,9 @@ namespace documents { let sourceColumn = 0; let nameIndex = 0; let match: RegExpExecArray | null; - while (match = mappingRegExp.exec(this.raw.mappings)) { + while (match = SourceMap._mappingRegExp.exec(this.raw.mappings)) { if (match[1]) { - const segment = decodeVLQ(match[1]); + const segment = SourceMap._decodeVLQ(match[1]); if (segment.length !== 1 && segment.length !== 4 && segment.length !== 5) { throw new Error("Invalid VLQ"); } @@ -120,14 +124,14 @@ namespace documents { public static getUrl(text: string) { let match: RegExpExecArray | null; let lastMatch: RegExpExecArray | undefined; - while (match = sourceMappingURLRegExp.exec(text)) { + while (match = SourceMap._sourceMappingURLRegExp.exec(text)) { lastMatch = match; } return lastMatch ? lastMatch[1] : undefined; } public static fromUrl(url: string) { - const match = dataURLRegExp.exec(url); + const match = SourceMap._dataURLRegExp.exec(url); return match ? new SourceMap(/*mapFile*/ undefined, new Buffer(match[1], "base64").toString("utf8")) : undefined; } @@ -144,26 +148,24 @@ namespace documents { const mappingsForSource = this._sourceLineMappings[sourceIndex]; return mappingsForSource && mappingsForSource[sourceLine]; } - } - const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - - export function decodeVLQ(text: string) { - const vlq: number[] = []; - let shift = 0; - let value = 0; - for (let i = 0; i < text.length; i++) { - const currentByte = base64Chars.indexOf(text.charAt(i)); - value += (currentByte & 31) << shift; - if ((currentByte & 32) === 0) { - vlq.push(value & 1 ? -(value >>> 1) : value >>> 1); - shift = 0; - value = 0; - } - else { - shift += 5; + private static _decodeVLQ(text: string): number[] { + const vlq: number[] = []; + let shift = 0; + let value = 0; + for (let i = 0; i < text.length; i++) { + const currentByte = SourceMap._base64Chars.indexOf(text.charAt(i)); + value += (currentByte & 31) << shift; + if ((currentByte & 32) === 0) { + vlq.push(value & 1 ? -(value >>> 1) : value >>> 1); + shift = 0; + value = 0; + } + else { + shift += 5; + } } + return vlq; } - return vlq; } } \ No newline at end of file diff --git a/src/harness/events.ts b/src/harness/events.ts index 684995d4250ab..f882f461729a5 100644 --- a/src/harness/events.ts +++ b/src/harness/events.ts @@ -1,4 +1,8 @@ /// + +// NOTE: The contents of this file are all exported from the namespace 'events'. This is to +// support the eventual conversion of harness into a modular system. + namespace events { const _events = require("events"); diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 2ab0b8c7a35bf..1d17c78478361 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1222,8 +1222,8 @@ namespace Harness { const fileOutputs = compilation.outputs ? compilation.outputs.map(output => ({ fileName: output.file, - code: utils.removeByteOrderMark(output.text), - writeByteOrderMark: utils.getByteOrderMarkLength(output.text) > 0 + code: core.removeByteOrderMark(output.text), + writeByteOrderMark: core.getByteOrderMarkLength(output.text) > 0 })) : []; const traceResults = compilation.traces && compilation.traces.slice(); @@ -1856,13 +1856,15 @@ namespace Harness { return opts; } - /** Given a test file containing // @FileName directives, return an array of named units of code to be added to an existing compiler instance */ - export function makeUnitsFromTest(code: string, fileName: string, rootDir?: string): { + export interface TestCaseContent { settings: CompilerSettings; testUnitData: TestUnitData[]; tsConfig: ts.ParsedCommandLine; tsConfigFileUnitData: TestUnitData; - } { + } + + /** Given a test file containing // @FileName directives, return an array of named units of code to be added to an existing compiler instance */ + export function makeUnitsFromTest(code: string, fileName: string, rootDir?: string): TestCaseContent { const settings = extractCompilerSettings(code); // List of all the subfiles we've parsed out diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 26f60116009f4..8e853bbf3b900 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -83,9 +83,9 @@ "harness.ts", + "core.ts", "utils.ts", "events.ts", - "collections.ts", "documents.ts", "vpath.ts", "vfs.ts", diff --git a/src/harness/unittests/programMissingFiles.ts b/src/harness/unittests/programMissingFiles.ts index 6e0602998f0a8..8c042f2afbc6f 100644 --- a/src/harness/unittests/programMissingFiles.ts +++ b/src/harness/unittests/programMissingFiles.ts @@ -42,7 +42,7 @@ namespace ts { const testCompilerHost = new compiler.CompilerHost( vfs.VirtualFileSystem.createFromTestFiles( - { useCaseSensitiveFileNames: false, currentDirectory: "d:\\pretend\\" }, + { useCaseSensitiveFileNames: false, currentDirectory: "d:\\pretend\\" }, [emptyFile, referenceFile]), { newLine: NewLineKind.LineFeed }); diff --git a/src/harness/utils.ts b/src/harness/utils.ts index 518a1be993fa4..4d0d43d7fba18 100644 --- a/src/harness/utils.ts +++ b/src/harness/utils.ts @@ -1,26 +1,9 @@ -namespace utils { - export function identity(v: T) { return v; } - - export function getByteOrderMarkLength(text: string) { - if (text.length >= 2) { - const ch0 = text.charCodeAt(0); - const ch1 = text.charCodeAt(1); - if ((ch0 === 0xff && ch1 === 0xfe) || - (ch0 === 0xfe && ch1 === 0xff)) { - return 2; - } - if (text.length >= 3 && ch0 === 0xef && ch1 === 0xbb && text.charCodeAt(2) === 0xbf) { - return 3; - } - } - return 0; - } +/// - export function removeByteOrderMark(text: string) { - const length = getByteOrderMarkLength(text); - return length ? text.slice(length) : text; - } +// NOTE: The contents of this file are all exported from the namespace 'core'. This is to +// support the eventual conversion of harness into a modular system. +namespace utils { const leadingCommentRegExp = /^(\s*\/\*[^]*?\*\/\s*|\s*\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)+/; const trailingCommentRegExp = /(\s*\/\*[^]*?\*\/\s*|\s*\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)+$/; const leadingAndTrailingCommentRegExp = /^(\s*\/\*[^]*?\*\/\s*|\s*\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)+|(\s*\/\*[^]*?\*\/\s*|\s*\/\/[^\r\n\u2028\u2029]*[\r\n\u2028\u2029]*)+$/g; diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index 643b805a926a8..da4f4ae190c73 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -1,13 +1,13 @@ +/// /// -/// +/// /// /// -/// -namespace vfs { - import KeyedCollection = collections.KeyedCollection; - import Metadata = collections.Metadata; - import EventEmitter = events.EventEmitter; +// NOTE: The contents of this file are all exported from the namespace 'vfs'. This is to +// support the eventual conversion of harness into a modular system. + +namespace vfs { export interface PathMappings { [path: string]: string; } @@ -89,7 +89,7 @@ namespace vfs { recursive: boolean; } - export abstract class VirtualFileSystemObject extends EventEmitter { + export abstract class VirtualFileSystemObject extends events.EventEmitter { private _readonly = false; /** @@ -121,11 +121,11 @@ namespace vfs { private _currentDirectory: string; private _currentDirectoryStack: string[] | undefined; private _shadowRoot: VirtualFileSystem | undefined; - private _watchedFiles: KeyedCollection | undefined; - private _watchedDirectories: KeyedCollection | undefined; + private _watchedFiles: core.KeyedCollection | undefined; + private _watchedDirectories: core.KeyedCollection | undefined; private _stringComparer: ts.Comparer | undefined; private _pathComparer: ts.Comparer | undefined; - private _metadata: Metadata; + private _metadata: core.Metadata; private _onRootFileSystemChange: (path: string, change: FileSystemChange) => void; constructor(currentDirectory: string, useCaseSensitiveFileNames: boolean) { @@ -137,8 +137,8 @@ namespace vfs { public get stringComparer() { return this._stringComparer || (this._stringComparer = this.useCaseSensitiveFileNames - ? collections.compareStringsCaseSensitive - : collections.compareStringsCaseInsensitive); + ? core.compareStringsCaseSensitive + : core.compareStringsCaseInsensitive); } public get pathComparer() { @@ -157,8 +157,8 @@ namespace vfs { /** * Gets metadata about this file system. */ - public get metadata(): Metadata { - return this._metadata || (this._metadata = new Metadata(this.shadowRoot ? this.shadowRoot.metadata : undefined)); + public get metadata(): core.Metadata { + return this._metadata || (this._metadata = new core.Metadata(this.shadowRoot ? this.shadowRoot.metadata : undefined)); } /** @@ -447,7 +447,7 @@ namespace vfs { public watchFile(path: string, watcher: (path: string, change: FileSystemChange) => void): ts.FileWatcher { if (!this._watchedFiles) { const pathComparer = this.useCaseSensitiveFileNames ? vpath.compareCaseSensitive : vpath.compareCaseInsensitive; - this._watchedFiles = new KeyedCollection(pathComparer); + this._watchedFiles = new core.KeyedCollection(pathComparer); } path = vpath.resolve(this.currentDirectory, path); @@ -476,7 +476,7 @@ namespace vfs { public watchDirectory(path: string, watcher: (path: string) => void, recursive?: boolean) { if (!this._watchedDirectories) { const pathComparer = this.useCaseSensitiveFileNames ? vpath.compareCaseSensitive : vpath.compareCaseInsensitive; - this._watchedDirectories = new KeyedCollection(pathComparer); + this._watchedDirectories = new core.KeyedCollection(pathComparer); } path = vpath.resolve(this.currentDirectory, path); @@ -590,7 +590,7 @@ namespace vfs { export abstract class VirtualFileSystemEntry extends VirtualFileSystemObject { private _path: string; - private _metadata: Metadata; + private _metadata: core.Metadata; /** * Gets the name of this entry. @@ -623,8 +623,8 @@ namespace vfs { /** * Gets metadata about this entry. */ - public get metadata(): Metadata { - return this._metadata || (this._metadata = new Metadata(this.shadowRoot ? this.shadowRoot.metadata : undefined)); + public get metadata(): core.Metadata { + return this._metadata || (this._metadata = new core.Metadata(this.shadowRoot ? this.shadowRoot.metadata : undefined)); } /** @@ -724,7 +724,7 @@ namespace vfs { export class VirtualDirectory extends VirtualFileSystemEntry { protected _shadowRoot: VirtualDirectory | undefined; private _parent: VirtualDirectory; - private _entries: KeyedCollection | undefined; + private _entries: core.KeyedCollection | undefined; private _resolver: FileSystemResolver | undefined; private _onChildFileSystemChange: (path: string, change: FileSystemChange) => void; @@ -990,7 +990,7 @@ namespace vfs { protected getOwnEntries() { if (!this._entries) { - const entries = new KeyedCollection(this.fileSystem.stringComparer); + const entries = new core.KeyedCollection(this.fileSystem.stringComparer); const resolver = this._resolver; const shadowRoot = this._shadowRoot; if (resolver) { @@ -1136,8 +1136,8 @@ namespace vfs { export class VirtualDirectorySymlink extends VirtualDirectory { private _targetPath: string; private _target: VirtualDirectory | undefined; - private _views: KeyedCollection | undefined; - private _allViews: KeyedCollection | undefined; + private _views: core.KeyedCollection | undefined; + private _allViews: core.KeyedCollection | undefined; private _onTargetParentChildRemoved: (entry: VirtualEntry) => void; private _onTargetChildRemoved: (entry: VirtualEntry) => void; private _onTargetChildAdded: (entry: VirtualEntry) => void; @@ -1145,7 +1145,7 @@ namespace vfs { constructor(parent: VirtualDirectory, name: string, target: string) { super(parent, name); - this._views = new KeyedCollection(this.fileSystem.stringComparer); + this._views = new core.KeyedCollection(this.fileSystem.stringComparer); this._targetPath = target; this._onTargetParentChildRemoved = entry => this.onTargetParentChildRemoved(entry); this._onTargetChildAdded = entry => this.onTargetChildAdded(entry); @@ -1225,9 +1225,9 @@ namespace vfs { return target && target.removeFile(name) || false; } - protected getOwnEntries(): KeyedCollection { + protected getOwnEntries(): core.KeyedCollection { if (!this._allViews) { - this._allViews = new KeyedCollection(this.fileSystem.stringComparer); + this._allViews = new core.KeyedCollection(this.fileSystem.stringComparer); const target = this.target; if (target) { for (const entry of target.getEntries()) { diff --git a/src/harness/vpath.ts b/src/harness/vpath.ts index 7a7669a4e1029..9ad081ac1f576 100644 --- a/src/harness/vpath.ts +++ b/src/harness/vpath.ts @@ -1,11 +1,13 @@ /// -namespace vpath { - // NOTE: Some of the functions here duplicate functionality from compiler/core.ts. They have been added - // to reduce the number of direct dependencies on compiler and services to eventually break away - // from depending directly on the compiler to speed up compilation time. - import compareValues = collections.compareNumbers; - import compareStrings = collections.compareStrings; +// NOTE: The contents of this file are all exported from the namespace 'vpath'. This is to +// support the eventual conversion of harness into a modular system. + +// NOTE: Some of the functions here duplicate functionality from compiler/core.ts. They have been +// added to reduce the number of direct dependencies on compiler and services to eventually +// break away from depending directly on the compiler to speed up compilation time. + +namespace vpath { /** * Virtual path separator. @@ -101,10 +103,7 @@ namespace vpath { return normalize(combine(path, ...paths)); } - /** - * Gets a relative path that can be used to traverse between `from` and `to`. - */ - export function relative(from: string, to: string, ignoreCase: boolean) { + function relativeWorker(from: string, to: string, stringEqualityComparer: core.EqualityComparer) { if (!isAbsolute(from)) throw new Error("Path not absolute"); if (!isAbsolute(to)) throw new Error("Path not absolute"); @@ -113,7 +112,7 @@ namespace vpath { let start: number; for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { - if (compareStrings(fromComponents[start], toComponents[start], ignoreCase)) { + if (stringEqualityComparer(fromComponents[start], toComponents[start])) { break; } } @@ -130,10 +129,22 @@ namespace vpath { return format(["", ...components]); } + function relativeCaseSensitive(from: string, to: string) { + return relativeWorker(from, to, core.equateStringsCaseSensitive); + } + + function relativeCaseInsensitive(from: string, to: string) { + return relativeWorker(from, to, core.equateStringsCaseInsensitive); + } + /** - * Compare two paths. + * Gets a relative path that can be used to traverse between `from` and `to`. */ - export function compare(a: string, b: string, ignoreCase: boolean) { + export function relative(from: string, to: string, ignoreCase: boolean) { + return ignoreCase ? relativeCaseInsensitive(from, to) : relativeCaseSensitive(from, to); + } + + function compareWorker(a: string, b: string, stringComparer: core.Comparer) { if (a === b) return 0; a = removeTrailingSeparator(a); b = removeTrailingSeparator(b); @@ -142,21 +153,32 @@ namespace vpath { const bComponents = reduce(parse(b)); const len = Math.min(aComponents.length, bComponents.length); for (let i = 0; i < len; i++) { - const result = compareStrings(aComponents[i], bComponents[i], ignoreCase); + const result = stringComparer(aComponents[i], bComponents[i]); if (result !== 0) return result; } - return compareValues(aComponents.length, bComponents.length); + return core.compareNumbers(aComponents.length, bComponents.length); } /** * Performs a case-sensitive comparison of two paths. */ - export function compareCaseSensitive(a: string, b: string) { return compare(a, b, /*ignoreCase*/ false); } + export function compareCaseSensitive(a: string, b: string) { + return compareWorker(a, b, core.compareStringsCaseSensitive); + } /** * Performs a case-insensitive comparison of two paths. */ - export function compareCaseInsensitive(a: string, b: string) { return compare(a, b, /*ignoreCase*/ true); } + export function compareCaseInsensitive(a: string, b: string) { + return compareWorker(a, b, core.compareStringsCaseInsensitive); + } + + /** + * Compare two paths. + */ + export function compare(a: string, b: string, ignoreCase: boolean) { + return ignoreCase ? compareCaseInsensitive(a, b) : compareCaseSensitive(a, b); + } /** * Determines whether two strings are equal. @@ -174,24 +196,35 @@ namespace vpath { return ignoreCase && a.toUpperCase() === b.toUpperCase(); } - /** - * Determines whether the path `descendant` is beneath the path `ancestor`. - */ - export function beneath(ancestor: string, descendant: string, ignoreCase: boolean) { + function beneathWorker(ancestor: string, descendant: string, stringEqualityComparer: ts.EqualityComparer) { if (!isAbsolute(ancestor)) throw new Error("Path not absolute"); if (!isAbsolute(descendant)) throw new Error("Path not absolute"); const ancestorComponents = reduce(parse(ancestor)); const descendantComponents = reduce(parse(descendant)); if (descendantComponents.length < ancestorComponents.length) return false; - const equalityComparer = ignoreCase ? collections.equateStringsCaseInsensitive : collections.equateStringsCaseSensitive; for (let i = 0; i < ancestorComponents.length; i++) { - if (!equalityComparer(ancestorComponents[i], descendantComponents[i])) { + if (!stringEqualityComparer(ancestorComponents[i], descendantComponents[i])) { return false; } } return true; } + function beneathCaseSensitive(ancestor: string, descendant: string) { + return beneathWorker(ancestor, descendant, core.equateStringsCaseSensitive); + } + + function beneathCaseInsensitive(ancestor: string, descendant: string) { + return beneathWorker(ancestor, descendant, core.equateStringsCaseInsensitive); + } + + /** + * Determines whether the path `descendant` is beneath the path `ancestor`. + */ + export function beneath(ancestor: string, descendant: string, ignoreCase: boolean) { + return ignoreCase ? beneathCaseInsensitive(ancestor, descendant) : beneathCaseSensitive(ancestor, descendant); + } + /** * Parse a path into a root component and zero or more path segments. * If the path is relative, the root component is `""`. @@ -239,6 +272,21 @@ namespace vpath { const extRegExp = /\.\w+$/; + function extnameWorker(path: string, extensions: string | string[], stringEqualityComparer: core.EqualityComparer) { + const manyExtensions = Array.isArray(extensions) ? extensions : undefined; + const singleExtension = Array.isArray(extensions) ? undefined : extensions; + const length = manyExtensions ? manyExtensions.length : 1; + for (let i = 0; i < length; i++) { + let extension = manyExtensions ? manyExtensions[i] : singleExtension; + if (!extension.startsWith(".")) extension = "." + extension; + if (path.length >= extension.length && + stringEqualityComparer(path.slice(path.length - extension.length), extension)) { + return extension; + } + } + return ""; + } + /** * Gets the file extension for a path. */ @@ -249,19 +297,7 @@ namespace vpath { export function extname(path: string, extensions: string | string[], ignoreCase: boolean): string; export function extname(path: string, extensions?: string | string[], ignoreCase?: boolean) { if (extensions) { - const manyExtensions = Array.isArray(extensions) ? extensions : undefined; - const singleExtension = Array.isArray(extensions) ? undefined : extensions; - const length = manyExtensions ? manyExtensions.length : 1; - const comparer = ignoreCase ? collections.compareStringsCaseInsensitive : collections.compareStringsCaseSensitive; - for (let i = 0; i < length; i++) { - let extension = manyExtensions ? manyExtensions[i] : singleExtension; - if (!extension.startsWith(".")) extension = "." + extension; - if (path.length >= extension.length && - comparer(path.slice(path.length - extension.length), extension) === 0) { - return extension; - } - } - return ""; + return extnameWorker(path, extensions, ignoreCase ? core.equateStringsCaseInsensitive : core.equateStringsCaseSensitive); } const match = extRegExp.exec(path); From cd0809e4d6244eec580271b0d59aa7f295fece14 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 10 Nov 2017 13:52:12 -0800 Subject: [PATCH 10/54] Deprecate CompilerResult --- src/harness/compiler.ts | 56 ++++++--- src/harness/compilerRunner.ts | 2 +- src/harness/core.ts | 70 +++++++++-- src/harness/documents.ts | 33 +++++ src/harness/harness.ts | 120 ++++--------------- src/harness/projectsRunner.ts | 13 +- src/harness/rwcRunner.ts | 2 +- src/harness/sourceMapRecorder.ts | 2 +- src/harness/test262Runner.ts | 2 +- src/harness/unittests/programMissingFiles.ts | 27 ++--- src/harness/vfs.ts | 26 ++-- src/harness/vpath.ts | 52 ++++---- 12 files changed, 225 insertions(+), 180 deletions(-) diff --git a/src/harness/compiler.ts b/src/harness/compiler.ts index 680f1f6097840..24bd14ecfe968 100644 --- a/src/harness/compiler.ts +++ b/src/harness/compiler.ts @@ -227,14 +227,22 @@ namespace compiler { public readonly program: ts.Program | undefined; public readonly result: ts.EmitResult | undefined; public readonly options: ts.CompilerOptions; - public readonly diagnostics: ts.Diagnostic[]; - public readonly js: core.KeyedCollection; - public readonly dts: core.KeyedCollection; - public readonly maps: core.KeyedCollection; + public readonly diagnostics: ReadonlyArray; + public readonly js: core.ReadonlyKeyedCollection; + public readonly dts: core.ReadonlyKeyedCollection; + public readonly maps: core.ReadonlyKeyedCollection; private _inputs: documents.TextDocument[] = []; private _inputsAndOutputs: core.KeyedCollection; + // from CompilerResult + public readonly files: ReadonlyArray; + public readonly declFilesCode: ReadonlyArray; + public readonly sourceMaps: ReadonlyArray; + public readonly errors: ReadonlyArray; + public readonly currentDirectoryForProgram: string; + public readonly traceResults: ReadonlyArray; + constructor(host: CompilerHost, options: ts.CompilerOptions, program: ts.Program | undefined, result: ts.EmitResult | undefined, diagnostics: ts.Diagnostic[]) { this.host = host; this.program = program; @@ -243,18 +251,18 @@ namespace compiler { this.options = program ? program.getCompilerOptions() : options; // collect outputs - this.js = new core.KeyedCollection(this.vfs.pathComparer); - this.dts = new core.KeyedCollection(this.vfs.pathComparer); - this.maps = new core.KeyedCollection(this.vfs.pathComparer); + const js = this.js = new core.KeyedCollection(this.vfs.pathComparer); + const dts = this.dts = new core.KeyedCollection(this.vfs.pathComparer); + const maps = this.maps = new core.KeyedCollection(this.vfs.pathComparer); for (const document of this.host.outputs) { if (vpath.isJavaScript(document.file)) { - this.js.set(document.file, document); + js.set(document.file, document); } else if (vpath.isDeclaration(document.file)) { - this.dts.set(document.file, document); + dts.set(document.file, document); } else if (vpath.isSourceMap(document.file)) { - this.maps.set(document.file, document); + maps.set(document.file, document); } } @@ -268,9 +276,9 @@ namespace compiler { if (!vpath.isDeclaration(sourceFile.fileName)) { const outputs = { input, - js: this.js.get(this.getOutputPath(sourceFile.fileName, ts.getOutputExtension(sourceFile, this.options))), - dts: this.dts.get(this.getOutputPath(sourceFile.fileName, ".d.ts", this.options.declarationDir)), - map: this.maps.get(this.getOutputPath(sourceFile.fileName, ts.getOutputExtension(sourceFile, this.options) + ".map")) + js: js.get(this.getOutputPath(sourceFile.fileName, ts.getOutputExtension(sourceFile, this.options))), + dts: dts.get(this.getOutputPath(sourceFile.fileName, ".d.ts", this.options.declarationDir)), + map: maps.get(this.getOutputPath(sourceFile.fileName, ts.getOutputExtension(sourceFile, this.options) + ".map")) }; this._inputsAndOutputs.set(sourceFile.fileName, outputs); @@ -281,9 +289,17 @@ namespace compiler { } } } + + // from CompilerResult + this.files = Array.from(this.js.values(), file => file.asGeneratedFile()); + this.declFilesCode = Array.from(this.dts.values(), file => file.asGeneratedFile()); + this.sourceMaps = Array.from(this.maps.values(), file => file.asGeneratedFile()); + this.errors = diagnostics; + this.currentDirectoryForProgram = host.vfs.currentDirectory; + this.traceResults = host.traces; } - public get vfs() { + public get vfs(): vfs.VirtualFileSystem { return this.host.vfs; } @@ -326,6 +342,12 @@ namespace compiler { return outputs && outputs[kind]; } + public getSourceMapRecord(): string | undefined { + if (this.result.sourceMaps && this.result.sourceMaps.length > 0) { + return Harness.SourceMapRecorder.getSourceMapRecord(this.result.sourceMaps, this.program, this.files); + } + } + public getSourceMap(path: string): documents.SourceMap | undefined { if (this.options.noEmit || vpath.isDeclaration(path)) return undefined; if (this.options.inlineSourceMap) { @@ -338,7 +360,7 @@ namespace compiler { } } - public getOutputPath(path: string, ext: string, outDir: string | undefined = this.options.outDir) { + public getOutputPath(path: string, ext: string, outDir: string | undefined = this.options.outDir): string { if (outDir) { path = vpath.resolve(this.vfs.currentDirectory, path); const common = this.commonSourceDirectory; @@ -352,8 +374,7 @@ namespace compiler { } } - export function compileFiles(host: CompilerHost, rootFiles: string[] | undefined, compilerOptions: ts.CompilerOptions) { - // establish defaults (aligns with old harness) + export function compileFiles(host: CompilerHost, rootFiles: string[] | undefined, compilerOptions: ts.CompilerOptions): CompilationResult { if (compilerOptions.project || !rootFiles || rootFiles.length === 0) { const project = readProject(host.parseConfigHost, compilerOptions.project, compilerOptions); if (project) { @@ -368,6 +389,7 @@ namespace compiler { delete compilerOptions.project; } + // establish defaults (aligns with old harness) if (compilerOptions.target === undefined) compilerOptions.target = ts.ScriptTarget.ES3; if (compilerOptions.newLine === undefined) compilerOptions.newLine = ts.NewLineKind.CarriageReturnLineFeed; if (compilerOptions.skipDefaultLibCheck === undefined) compilerOptions.skipDefaultLibCheck = true; diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 5eb78f746dff4..6d0ce05083e1c 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -108,7 +108,7 @@ class CompilerTest { private lastUnit: Harness.TestCaseParser.TestUnitData; private harnessSettings: Harness.TestCaseParser.CompilerSettings; private hasNonDtsFiles: boolean; - private result: Harness.Compiler.CompilerResult; + private result: compiler.CompilationResult; private options: ts.CompilerOptions; private tsConfigFiles: Harness.Compiler.TestFile[]; // equivalent to the files that will be passed on the command line diff --git a/src/harness/core.ts b/src/harness/core.ts index 9efe53c4d8a77..259e05d6765d9 100644 --- a/src/harness/core.ts +++ b/src/harness/core.ts @@ -1,5 +1,3 @@ -/// - // NOTE: The contents of this file are all exported from the namespace 'core'. This is to // support the eventual conversion of harness into a modular system. @@ -63,10 +61,20 @@ namespace core { // Collections // + export interface ReadonlyKeyedCollection { + readonly size: number; + has(key: K): boolean; + get(key: K): V | undefined; + forEach(callback: (value: V, key: K, collection: this) => void): void; + keys(): IterableIterator; + values(): IterableIterator; + entries(): IterableIterator<[K, V]>; + } + /** * A collection of key/value pairs internally sorted by key. */ - export class KeyedCollection { + export class KeyedCollection implements ReadonlyKeyedCollection { private _comparer: (a: K, b: K) => number; private _keys: K[] = []; private _values: V[] = []; @@ -101,7 +109,7 @@ namespace core { insertAt(this._keys, ~index, key); insertAt(this._values, ~index, value); insertAt(this._order, ~index, this._version); - this._version++; + this.writePostScript(); } return this; } @@ -113,7 +121,7 @@ namespace core { removeAt(this._keys, index); removeAt(this._values, index); removeAt(this._order, index); - this._version++; + this.writePostScript(); return true; } return false; @@ -125,7 +133,7 @@ namespace core { this._keys.length = 0; this._values.length = 0; this._order.length = 0; - this._version = 0; + this.writePostScript(); } } @@ -143,6 +151,46 @@ namespace core { } } + public * keys() { + const keys = this._keys; + const order = this.getInsertionOrder(); + const version = this._version; + this._copyOnWrite = true; + for (const index of order) { + yield keys[index]; + } + if (version === this._version) { + this._copyOnWrite = false; + } + } + + public * values() { + const values = this._values; + const order = this.getInsertionOrder(); + const version = this._version; + this._copyOnWrite = true; + for (const index of order) { + yield values[index]; + } + if (version === this._version) { + this._copyOnWrite = false; + } + } + + public * entries() { + const keys = this._keys; + const values = this._values; + const order = this.getInsertionOrder(); + const version = this._version; + this._copyOnWrite = true; + for (const index of order) { + yield [keys[index], values[index]] as [K, V]; + } + if (version === this._version) { + this._copyOnWrite = false; + } + } + private writePreamble() { if (this._copyOnWrite) { this._keys = this._keys.slice(); @@ -152,10 +200,14 @@ namespace core { } } + private writePostScript() { + this._version++; + } + private getInsertionOrder() { return this._order .map((_, i) => i) - .sort((x, y) => compareNumbers(this._order[x], this._order[y])); + .sort((x, y) => this._order[x] - this._order[y]); } } @@ -325,6 +377,10 @@ namespace core { return length ? text.slice(length) : text; } + export function addUTF8ByteOrderMark(text: string) { + return getByteOrderMarkLength(text) === 0 ? "\u00EF\u00BB\u00BF" + text : text; + } + function splitLinesWorker(text: string, lineStarts: number[] | undefined, lines: string[] | undefined, removeEmptyElements: boolean) { let pos = 0; let end = 0; diff --git a/src/harness/documents.ts b/src/harness/documents.ts index a5df3a6af5258..9857716ad4197 100644 --- a/src/harness/documents.ts +++ b/src/harness/documents.ts @@ -10,6 +10,8 @@ namespace documents { public readonly text: string; private _lineStarts: core.LineStarts | undefined; + private _testFile: Harness.Compiler.TestFile | undefined; + private _generatedFile: Harness.Compiler.GeneratedFile | undefined; constructor(file: string, text: string, meta?: Map) { this.file = file; @@ -20,6 +22,37 @@ namespace documents { public get lineStarts(): core.LineStarts { return this._lineStarts || (this._lineStarts = core.computeLineStarts(this.text)); } + + public static fromTestFile(file: Harness.Compiler.TestFile) { + return new TextDocument( + file.unitName, + file.content, + file.fileOptions && Object.keys(file.fileOptions) + .reduce((meta, key) => meta.set(key, file.fileOptions[key]), new Map())); + } + + public asTestFile() { + return this._testFile || (this._testFile = { + unitName: this.file, + content: this.text, + fileOptions: Array.from(this.meta) + .reduce((obj, [key, value]) => (obj[key] = value, obj), {} as Record) + }); + } + + public static fromGeneratedFile(file: Harness.Compiler.GeneratedFile) { + return new TextDocument( + file.fileName, + file.writeByteOrderMark ? core.addUTF8ByteOrderMark(file.code) : file.code); + } + + public asGeneratedFile() { + return this._generatedFile || (this._generatedFile = { + fileName: this.file, + code: core.removeByteOrderMark(this.text), + writeByteOrderMark: core.getByteOrderMarkLength(this.text) > 0 + }); + } } export interface RawSourceMap { diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 1d17c78478361..88fcaa329e7fb 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -482,7 +482,7 @@ namespace Utils { } namespace Harness { - // tslint:disable-next-line:interface-name + // tslint:disable-next-line:interface-name export interface IO { newLine(): string; getCurrentDirectory(): string; @@ -1163,7 +1163,7 @@ namespace Harness { } export interface CompilationOutput { - result: CompilerResult; + result: compiler.CompilationResult; options: ts.CompilerOptions & HarnessOptions; } @@ -1208,29 +1208,24 @@ namespace Harness { } } - const compilation = compiler.compileFiles( + const result = compiler.compileFiles( new compiler.CompilerHost( - vfs.VirtualFileSystem.createFromTestFiles( - { useCaseSensitiveFileNames, currentDirectory }, - inputFiles.concat(otherFiles), - { overwrite: true } + vfs.VirtualFileSystem.createFromDocuments( + useCaseSensitiveFileNames, + inputFiles.concat(otherFiles).map(documents.TextDocument.fromTestFile), + { currentDirectory, overwrite: true } ), options ), programFileNames, options); - const fileOutputs = compilation.outputs ? compilation.outputs.map(output => ({ - fileName: output.file, - code: core.removeByteOrderMark(output.text), - writeByteOrderMark: core.getByteOrderMarkLength(output.text) > 0 - })) : []; - - const traceResults = compilation.traces && compilation.traces.slice(); - const program = compilation.program; - const emitResult = compilation.result; - const errors = compilation.diagnostics; - const result = new CompilerResult(fileOutputs, errors, program, compilation.vfs.currentDirectory, emitResult.sourceMaps, traceResults); + // const fileOutputs = compilation.outputs.map(output => output.asGeneratedFile()); + // const traceResults = compilation.traces && compilation.traces.slice(); + // const program = compilation.program; + // const emitResult = compilation.result; + // const errors = compilation.diagnostics; + // const result = new CompilerResult(fileOutputs, errors, program, compilation.vfs.currentDirectory, emitResult.sourceMaps, traceResults); return { result, options }; } @@ -1242,9 +1237,9 @@ namespace Harness { currentDirectory: string; } - export function prepareDeclarationCompilationContext(inputFiles: TestFile[], - otherFiles: TestFile[], - result: CompilerResult, + export function prepareDeclarationCompilationContext(inputFiles: ReadonlyArray, + otherFiles: ReadonlyArray, + result: compiler.CompilationResult, harnessSettings: TestCaseParser.CompilerSettings & HarnessOptions, options: ts.CompilerOptions, // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file @@ -1264,10 +1259,10 @@ namespace Harness { } function addDtsFile(file: TestFile, dtsFiles: TestFile[]) { - if (isDTS(file.unitName)) { + if (vpath.isDeclaration(file.unitName)) { dtsFiles.push(file); } - else if (isTS(file.unitName)) { + else if (vpath.isTypeScript(file.unitName)) { const declFile = findResultCodeFile(file.unitName); if (declFile && !findUnit(declFile.fileName, declInputFiles) && !findUnit(declFile.fileName, declOtherFiles)) { dtsFiles.push({ unitName: declFile.fileName, content: declFile.code }); @@ -1465,7 +1460,7 @@ namespace Harness { assert.equal(totalErrorsReportedInNonLibraryFiles + numLibraryDiagnostics + numTest262HarnessDiagnostics, diagnostics.length, "total number of errors"); } - export function doErrorBaseline(baselinePath: string, inputFiles: TestFile[], errors: ts.Diagnostic[], pretty?: boolean) { + export function doErrorBaseline(baselinePath: string, inputFiles: ReadonlyArray, errors: ReadonlyArray, pretty?: boolean) { Harness.Baseline.runBaseline(baselinePath.replace(/\.tsx?$/, ".errors.txt"), (): string => { if (!errors || (errors.length === 0)) { /* tslint:disable:no-null-keyword */ @@ -1611,7 +1606,7 @@ namespace Harness { 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: compiler.CompilationResult, harnessSettings: Harness.TestCaseParser.CompilerSettings) { if (options.inlineSourceMap) { if (result.sourceMaps.length > 0) { throw new Error("No sourcemap files should be generated if inlineSourceMaps was set."); @@ -1642,7 +1637,7 @@ 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: compiler.CompilationResult, tsConfigFiles: ReadonlyArray, toBeCompiled: ReadonlyArray, otherFiles: ReadonlyArray, harnessSettings: Harness.TestCaseParser.CompilerSettings) { if (!options.noEmit && 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."); } @@ -1698,7 +1693,7 @@ namespace Harness { return "//// [" + fileName + "]\r\n" + getByteOrderMarkText(file) + utils.removeTestPathPrefixes(file.code); } - export function collateOutputs(outputFiles: Harness.Compiler.GeneratedFile[]): string { + export function collateOutputs(outputFiles: ReadonlyArray): string { const gen = iterateOutputs(outputFiles); // Emit them let result = ""; @@ -1714,9 +1709,9 @@ namespace Harness { return result; } - export function *iterateOutputs(outputFiles: Harness.Compiler.GeneratedFile[]): IterableIterator<[string, string]> { + export function *iterateOutputs(outputFiles: ReadonlyArray): IterableIterator<[string, string]> { // Collect, test, and sort the fileNames - outputFiles.sort((a, b) => ts.compareStringsCaseSensitive(cleanName(a.fileName), cleanName(b.fileName))); + outputFiles.slice().sort((a, b) => ts.compareStringsCaseSensitive(cleanName(a.fileName), cleanName(b.fileName))); const dupeCase = ts.createMap(); // Yield them for (const outputFile of outputFiles) { @@ -1751,78 +1746,11 @@ namespace Harness { return path; } - // This does not need to exist strictly speaking, but many tests will need to be updated if it's removed - export function compileString(_code: string, _unitName: string, _callback: (result: CompilerResult) => void) { - // NEWTODO: Re-implement 'compileString' - return ts.notImplemented(); - } - export interface GeneratedFile { fileName: string; code: string; writeByteOrderMark: boolean; } - - export function isTS(fileName: string) { - return ts.endsWith(fileName, ts.Extension.Ts); - } - - export function isTSX(fileName: string) { - return ts.endsWith(fileName, ts.Extension.Tsx); - } - - export function isDTS(fileName: string) { - return ts.endsWith(fileName, ts.Extension.Dts); - } - - export function isJS(fileName: string) { - return ts.endsWith(fileName, ts.Extension.Js); - } - export function isJSX(fileName: string) { - return ts.endsWith(fileName, ts.Extension.Jsx); - } - - export function isJSMap(fileName: string) { - return ts.endsWith(fileName, ".js.map") || ts.endsWith(fileName, ".jsx.map"); - } - - /** Contains the code and errors of a compilation and some helper methods to check its status. */ - export class CompilerResult { - public files: GeneratedFile[] = []; - public errors: ts.Diagnostic[] = []; - public declFilesCode: GeneratedFile[] = []; - public sourceMaps: GeneratedFile[] = []; - - /** @param fileResults an array of strings for the fileName and an ITextWriter with its code */ - constructor(fileResults: GeneratedFile[], errors: ts.Diagnostic[], public program: ts.Program, - public currentDirectoryForProgram: string, private sourceMapData: ts.SourceMapData[], public traceResults: string[]) { - - for (const emittedFile of fileResults) { - if (isDTS(emittedFile.fileName)) { - // .d.ts file, add to declFiles emit - this.declFilesCode.push(emittedFile); - } - else if (isJS(emittedFile.fileName) || isJSX(emittedFile.fileName)) { - // .js file, add to files - this.files.push(emittedFile); - } - else if (isJSMap(emittedFile.fileName)) { - this.sourceMaps.push(emittedFile); - } - else { - throw new Error("Unrecognized file extension for file " + emittedFile.fileName); - } - } - - this.errors = errors; - } - - public getSourceMapRecord() { - if (this.sourceMapData && this.sourceMapData.length > 0) { - return Harness.SourceMapRecorder.getSourceMapRecord(this.sourceMapData, this.program, this.files); - } - } - } } export namespace TestCaseParser { diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index c617cc7a0a3ec..73098ba3507b0 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -1,5 +1,6 @@ -/// -/// +/// +/// +/// // Test case is json of below type in tests/cases/project/ interface ProjectRunnerTestCase { @@ -319,19 +320,19 @@ class ProjectRunner extends RunnerBase { // we need to instead create files that can live in the project reference folder // but make sure extension of these files matches with the fileName the compiler asked to write diskRelativeName = "diskFile" + nonSubfolderDiskFiles + - (Harness.Compiler.isDTS(fileName) ? ts.Extension.Dts : - Harness.Compiler.isJS(fileName) ? ts.Extension.Js : ".js.map"); + (vpath.isDeclaration(fileName) ? ts.Extension.Dts : + vpath.isJavaScript(fileName) ? ts.Extension.Js : ".js.map"); nonSubfolderDiskFiles++; } - if (Harness.Compiler.isJS(fileName)) { + if (vpath.isJavaScript(fileName)) { // Make sure if there is URl we have it cleaned up const indexOfSourceMapUrl = data.lastIndexOf(`//# ${"sourceMappingURL"}=`); // This line can be seen as a sourceMappingURL comment if (indexOfSourceMapUrl !== -1) { data = data.substring(0, indexOfSourceMapUrl + 21) + cleanProjectUrl(data.substring(indexOfSourceMapUrl + 21)); } } - else if (Harness.Compiler.isJSMap(fileName)) { + else if (vpath.isJavaScriptSourceMap(fileName)) { // Make sure sources list is cleaned const sourceMapData = JSON.parse(data); for (let i = 0; i < sourceMapData.sources.length; i++) { diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index 31985529f901e..16beb92a54787 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -30,7 +30,7 @@ namespace RWC { let inputFiles: Harness.Compiler.TestFile[] = []; let otherFiles: Harness.Compiler.TestFile[] = []; let tsconfigFiles: Harness.Compiler.TestFile[] = []; - let compilerResult: Harness.Compiler.CompilerResult; + let compilerResult: compiler.CompilationResult; let compilerOptions: ts.CompilerOptions; const baselineOpts: Harness.Baseline.BaselineOptions = { Subfolder: "rwc", diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index 606d4e67acdf3..330ac1743ac9b 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -434,7 +434,7 @@ namespace Harness.SourceMapRecorder { } } - export function getSourceMapRecord(sourceMapDataList: ts.SourceMapData[], program: ts.Program, jsFiles: Compiler.GeneratedFile[]) { + export function getSourceMapRecord(sourceMapDataList: ReadonlyArray, program: ts.Program, jsFiles: ReadonlyArray) { const sourceMapRecorder = new Compiler.WriterAggregator(); for (let i = 0; i < sourceMapDataList.length; i++) { diff --git a/src/harness/test262Runner.ts b/src/harness/test262Runner.ts index 6c5b186f2b89e..0d32d2f251328 100644 --- a/src/harness/test262Runner.ts +++ b/src/harness/test262Runner.ts @@ -31,7 +31,7 @@ class Test262BaselineRunner extends RunnerBase { // Everything declared here should be cleared out in the "after" callback. let testState: { filename: string; - compilerResult: Harness.Compiler.CompilerResult; + compilerResult: compiler.CompilationResult; inputFiles: Harness.Compiler.TestFile[]; }; diff --git a/src/harness/unittests/programMissingFiles.ts b/src/harness/unittests/programMissingFiles.ts index 8c042f2afbc6f..f78bf13438949 100644 --- a/src/harness/unittests/programMissingFiles.ts +++ b/src/harness/unittests/programMissingFiles.ts @@ -1,4 +1,5 @@ /// +/// /// namespace ts { @@ -23,27 +24,23 @@ namespace ts { const emptyFileName = "empty.ts"; const emptyFileRelativePath = "./" + emptyFileName; - const emptyFile: Harness.Compiler.TestFile = { - unitName: emptyFileName, - content: "" - }; + const emptyFile = new documents.TextDocument(emptyFileName, ""); const referenceFileName = "reference.ts"; const referenceFileRelativePath = "./" + referenceFileName; - const referenceFile: Harness.Compiler.TestFile = { - unitName: referenceFileName, - content: - "/// \n" + // Absolute - "/// \n" + // Relative - "/// \n" + // Unqualified - "/// \n" // No extension - }; + const referenceFile = new documents.TextDocument(referenceFileName, + "/// \n" + // Absolute + "/// \n" + // Relative + "/// \n" + // Unqualified + "/// \n" // No extension + ); const testCompilerHost = new compiler.CompilerHost( - vfs.VirtualFileSystem.createFromTestFiles( - { useCaseSensitiveFileNames: false, currentDirectory: "d:\\pretend\\" }, - [emptyFile, referenceFile]), + vfs.VirtualFileSystem.createFromDocuments( + /*useCaseSensitiveFileNames*/ false, + [emptyFile, referenceFile], + { currentDirectory: "d:\\pretend\\" }), { newLine: NewLineKind.LineFeed }); it("handles no missing root files", () => { diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index da4f4ae190c73..7d31ae3df96b3 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -1,8 +1,9 @@ /// /// /// -/// /// +/// +/// // NOTE: The contents of this file are all exported from the namespace 'vfs'. This is to // support the eventual conversion of harness into a modular system. @@ -190,7 +191,7 @@ namespace vfs { } /** - * Gets a virtual file system with the following directories: + * Gets a read-only virtual file system with the following directories: * * | path | physical/virtual | * |:-------|:----------------------| @@ -198,7 +199,7 @@ namespace vfs { * | /.lib | physical: tests/lib | * | /.src | virtual | */ - public static getBuiltLocal(useCaseSensitiveFileNames: boolean = Harness.IO.useCaseSensitiveFileNames()): VirtualFileSystem { + public static getBuiltLocal(useCaseSensitiveFileNames: boolean): VirtualFileSystem { let vfs = useCaseSensitiveFileNames ? this._builtLocalCS : this._builtLocalCI; if (!vfs) { vfs = this._builtLocal; @@ -228,27 +229,24 @@ namespace vfs { return vfs; } - public static createFromOptions(options: { useCaseSensitiveFileNames?: boolean, currentDirectory?: string }) { - const vfs = this.getBuiltLocal(options.useCaseSensitiveFileNames).shadow(); - if (options.currentDirectory) { + public static createFromDocuments(useCaseSensitiveFileNames: boolean, documents: documents.TextDocument[], options?: { currentDirectory?: string, overwrite?: boolean }) { + const vfs = this.getBuiltLocal(useCaseSensitiveFileNames).shadow(); + if (options && options.currentDirectory) { vfs.addDirectory(options.currentDirectory); vfs.changeDirectory(options.currentDirectory); } - return vfs; - } - public static createFromTestFiles(options: { useCaseSensitiveFileNames?: boolean, currentDirectory?: string }, documents: Harness.Compiler.TestFile[], fileOptions?: { overwrite?: boolean }) { - const vfs = this.createFromOptions(options); + const fileOptions = options && options.overwrite ? { overwrite: true } : undefined; for (const document of documents) { - const file = vfs.addFile(document.unitName, document.content, fileOptions)!; - assert.isDefined(file, `Failed to add file: '${document.unitName}'`); + const file = vfs.addFile(document.file, document.text, fileOptions)!; + assert.isDefined(file, `Failed to add file: '${document.file}'`); file.metadata.set("document", document); // Add symlinks - const symlink = document.fileOptions && document.fileOptions.symlink; + const symlink = document.meta.get("symlink"); if (file && symlink) { for (const link of symlink.split(",")) { const symlink = vfs.addSymlink(vpath.resolve(vfs.currentDirectory, link.trim()), file)!; - assert.isDefined(symlink, `Failed to symlink: '${link}'`); + assert.isDefined(symlink, `Failed to create symlink: '${link}'`); symlink.metadata.set("document", document); } } diff --git a/src/harness/vpath.ts b/src/harness/vpath.ts index 9ad081ac1f576..c352b028c3f7e 100644 --- a/src/harness/vpath.ts +++ b/src/harness/vpath.ts @@ -59,7 +59,7 @@ namespace vpath { return hasTrailingSeparator(path) ? path.slice(0, -1) : path; } - function reduce(components: string[]) { + function reduce(components: ReadonlyArray) { const normalized = [components[0]]; for (let i = 1; i < components.length; i++) { const component = components[i]; @@ -242,7 +242,7 @@ namespace vpath { /** * Formats a parsed path consisting of a root component and zero or more path segments. */ - export function format(components: string[]) { + export function format(components: ReadonlyArray) { return components.length ? components[0] + components.slice(1).join(sep) : ""; } @@ -262,31 +262,33 @@ namespace vpath { * Gets the portion of a path following the last separator (`/`). * If the base name has any one of the provided extensions, it is removed. */ - export function basename(path: string, extensions: string | string[], ignoreCase: boolean): string; - export function basename(path: string, extensions?: string | string[], ignoreCase?: boolean) { + export function basename(path: string, extensions: string | ReadonlyArray, ignoreCase: boolean): string; + export function basename(path: string, extensions?: string | ReadonlyArray, ignoreCase?: boolean) { path = normalizeSeparators(path); const name = path.substr(Math.max(getRootLength(path), path.lastIndexOf(sep) + 1)); const extension = extensions ? extname(path, extensions, ignoreCase) : undefined; return extension ? name.slice(0, name.length - extension.length) : name; } - const extRegExp = /\.\w+$/; - - function extnameWorker(path: string, extensions: string | string[], stringEqualityComparer: core.EqualityComparer) { + function extnameWorker(path: string, extensions: string | ReadonlyArray, stringEqualityComparer: core.EqualityComparer) { const manyExtensions = Array.isArray(extensions) ? extensions : undefined; const singleExtension = Array.isArray(extensions) ? undefined : extensions; const length = manyExtensions ? manyExtensions.length : 1; for (let i = 0; i < length; i++) { let extension = manyExtensions ? manyExtensions[i] : singleExtension; if (!extension.startsWith(".")) extension = "." + extension; - if (path.length >= extension.length && - stringEqualityComparer(path.slice(path.length - extension.length), extension)) { - return extension; + if (path.length >= extension.length && path.charAt(path.length - extension.length) === ".") { + const pathExtension = path.slice(path.length - extension.length); + if (stringEqualityComparer(pathExtension, extension)) { + return pathExtension; + } } } return ""; } + const extRegExp = /\.\w+$/; + /** * Gets the file extension for a path. */ @@ -294,8 +296,8 @@ namespace vpath { /** * Gets the file extension for a path, provided it is one of the provided extensions. */ - export function extname(path: string, extensions: string | string[], ignoreCase: boolean): string; - export function extname(path: string, extensions?: string | string[], ignoreCase?: boolean) { + export function extname(path: string, extensions: string | ReadonlyArray, ignoreCase: boolean): string; + export function extname(path: string, extensions?: string | ReadonlyArray, ignoreCase?: boolean) { if (extensions) { return extnameWorker(path, extensions, ignoreCase ? core.equateStringsCaseInsensitive : core.equateStringsCaseSensitive); } @@ -305,32 +307,40 @@ namespace vpath { } export function changeExtension(path: string, ext: string): string; - export function changeExtension(path: string, ext: string, extensions: string | string[], ignoreCase: boolean): string; - export function changeExtension(path: string, ext: string, extensions?: string | string[], ignoreCase?: boolean) { + export function changeExtension(path: string, ext: string, extensions: string | ReadonlyArray, ignoreCase: boolean): string; + export function changeExtension(path: string, ext: string, extensions?: string | ReadonlyArray, ignoreCase?: boolean) { const pathext = extensions ? extname(path, extensions, ignoreCase) : extname(path); return pathext ? path.slice(0, path.length - pathext.length) + (ext.startsWith(".") ? ext : "." + ext) : path; } + const typeScriptExtensions: ReadonlyArray = [".ts", ".tsx"]; + export function isTypeScript(path: string) { - return path.endsWith(".ts") - || path.endsWith(".tsx"); + return extname(path, typeScriptExtensions, /*ignoreCase*/ false).length > 0; } + const javaScriptExtensions: ReadonlyArray = [".js", ".jsx"]; + export function isJavaScript(path: string) { - return path.endsWith(".js") - || path.endsWith(".jsx"); + return extname(path, javaScriptExtensions, /*ignoreCase*/ false).length > 0; } export function isDeclaration(path: string) { - return path.endsWith(".d.ts"); + return extname(path, ".d.ts", /*ignoreCase*/ false).length > 0; } export function isSourceMap(path: string) { - return path.endsWith(".map"); + return extname(path, ".map", /*ignoreCase*/ false).length > 0; + } + + const javaScriptSourceMapExtensions: ReadonlyArray = [".js.map", ".jsx.map"]; + + export function isJavaScriptSourceMap(path: string) { + return extname(path, javaScriptSourceMapExtensions, /*ignoreCase*/ false).length > 0; } export function isJson(path: string) { - return path.endsWith(".json"); + return extname(path, ".json", /*ignoreCase*/ false).length > 0; } export function isDefaultLibrary(path: string) { From 791c01eb980680bdf4cae33ad29aa515df28bba3 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 10 Nov 2017 14:55:04 -0800 Subject: [PATCH 11/54] Deprecate GeneratedFile --- src/harness/compiler.ts | 19 +++++-------- src/harness/compilerRunner.ts | 6 ++-- src/harness/core.ts | 5 ++++ src/harness/documents.ts | 15 ---------- src/harness/harness.ts | 44 ++++++++++++------------------ src/harness/projectsRunner.ts | 37 +++++++++++++------------ src/harness/rwcRunner.ts | 10 +++---- src/harness/sourceMapRecorder.ts | 21 +++++++------- src/harness/test262Runner.ts | 4 +-- src/harness/unittests/publicApi.ts | 2 +- 10 files changed, 71 insertions(+), 92 deletions(-) diff --git a/src/harness/compiler.ts b/src/harness/compiler.ts index 24bd14ecfe968..5a476268ea681 100644 --- a/src/harness/compiler.ts +++ b/src/harness/compiler.ts @@ -236,12 +236,9 @@ namespace compiler { private _inputsAndOutputs: core.KeyedCollection; // from CompilerResult - public readonly files: ReadonlyArray; - public readonly declFilesCode: ReadonlyArray; - public readonly sourceMaps: ReadonlyArray; - public readonly errors: ReadonlyArray; - public readonly currentDirectoryForProgram: string; - public readonly traceResults: ReadonlyArray; + public readonly files: ReadonlyArray; + public readonly declFilesCode: ReadonlyArray; + public readonly sourceMaps: ReadonlyArray; constructor(host: CompilerHost, options: ts.CompilerOptions, program: ts.Program | undefined, result: ts.EmitResult | undefined, diagnostics: ts.Diagnostic[]) { this.host = host; @@ -291,12 +288,10 @@ namespace compiler { } // from CompilerResult - this.files = Array.from(this.js.values(), file => file.asGeneratedFile()); - this.declFilesCode = Array.from(this.dts.values(), file => file.asGeneratedFile()); - this.sourceMaps = Array.from(this.maps.values(), file => file.asGeneratedFile()); - this.errors = diagnostics; - this.currentDirectoryForProgram = host.vfs.currentDirectory; - this.traceResults = host.traces; + this.files = Array.from(this.js.values()); + this.declFilesCode = Array.from(this.dts.values()); + this.sourceMaps = Array.from(this.maps.values()); + this.diagnostics = diagnostics; } public get vfs(): vfs.VirtualFileSystem { diff --git a/src/harness/compilerRunner.ts b/src/harness/compilerRunner.ts index 6d0ce05083e1c..ee7bc9835ecf0 100644 --- a/src/harness/compilerRunner.ts +++ b/src/harness/compilerRunner.ts @@ -208,14 +208,14 @@ class CompilerTest { Harness.Compiler.doErrorBaseline( this.justName, this.tsConfigFiles.concat(this.toBeCompiled, this.otherFiles), - this.result.errors, + this.result.diagnostics, !!this.options.pretty); } public verifyModuleResolution() { if (this.options.traceResolution) { Harness.Baseline.runBaseline(this.justName.replace(/\.tsx?$/, ".trace.json"), () => { - return utils.removeTestPathPrefixes(JSON.stringify(this.result.traceResults || [], undefined, 4)); + return utils.removeTestPathPrefixes(JSON.stringify(this.result.traces, undefined, 4)); }); } } @@ -224,7 +224,7 @@ class CompilerTest { if (this.options.sourceMap || this.options.inlineSourceMap) { Harness.Baseline.runBaseline(this.justName.replace(/\.tsx?$/, ".sourcemap.txt"), () => { const record = utils.removeTestPathPrefixes(this.result.getSourceMapRecord()); - if ((this.options.noEmitOnError && this.result.errors.length !== 0) || record === undefined) { + if ((this.options.noEmitOnError && this.result.diagnostics.length !== 0) || record === undefined) { // Because of the noEmitOnError option no files are created. We need to return null because baselining isn't required. /* tslint:disable:no-null-keyword */ return null; diff --git a/src/harness/core.ts b/src/harness/core.ts index 259e05d6765d9..c4f3a7878162a 100644 --- a/src/harness/core.ts +++ b/src/harness/core.ts @@ -357,6 +357,11 @@ namespace core { return text; } + export function getByteOrderMark(text: string): string { + const length = getByteOrderMarkLength(text); + return length > 0 ? text.slice(0, length) : ""; + } + export function getByteOrderMarkLength(text: string): number { if (text.length >= 2) { const ch0 = text.charCodeAt(0); diff --git a/src/harness/documents.ts b/src/harness/documents.ts index 9857716ad4197..fc4893ef4e83f 100644 --- a/src/harness/documents.ts +++ b/src/harness/documents.ts @@ -11,7 +11,6 @@ namespace documents { private _lineStarts: core.LineStarts | undefined; private _testFile: Harness.Compiler.TestFile | undefined; - private _generatedFile: Harness.Compiler.GeneratedFile | undefined; constructor(file: string, text: string, meta?: Map) { this.file = file; @@ -39,20 +38,6 @@ namespace documents { .reduce((obj, [key, value]) => (obj[key] = value, obj), {} as Record) }); } - - public static fromGeneratedFile(file: Harness.Compiler.GeneratedFile) { - return new TextDocument( - file.fileName, - file.writeByteOrderMark ? core.addUTF8ByteOrderMark(file.code) : file.code); - } - - public asGeneratedFile() { - return this._generatedFile || (this._generatedFile = { - fileName: this.file, - code: core.removeByteOrderMark(this.text), - writeByteOrderMark: core.getByteOrderMarkLength(this.text) > 0 - }); - } } export interface RawSourceMap { diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 88fcaa329e7fb..823b8a34cf2ac 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1244,7 +1244,7 @@ namespace Harness { options: ts.CompilerOptions, // Current directory is needed for rwcRunner to be able to use currentDirectory defined in json file currentDirectory: string): DeclarationCompilationContext | undefined { - if (options.declaration && result.errors.length === 0 && result.declFilesCode.length !== result.files.length) { + if (options.declaration && result.diagnostics.length === 0 && result.declFilesCode.length !== result.files.length) { throw new Error("There were no errors and declFiles generated did not match number of js files generated"); } @@ -1252,7 +1252,7 @@ namespace Harness { const declOtherFiles: TestFile[] = []; // if the .d.ts is non-empty, confirm it compiles correctly as well - if (options.declaration && result.errors.length === 0 && result.declFilesCode.length > 0) { + if (options.declaration && result.diagnostics.length === 0 && result.declFilesCode.length > 0) { ts.forEach(inputFiles, file => addDtsFile(file, declInputFiles)); ts.forEach(otherFiles, file => addDtsFile(file, declOtherFiles)); return { declInputFiles, declOtherFiles, harnessSettings, options, currentDirectory: currentDirectory || harnessSettings.currentDirectory }; @@ -1264,8 +1264,8 @@ namespace Harness { } else if (vpath.isTypeScript(file.unitName)) { const declFile = findResultCodeFile(file.unitName); - if (declFile && !findUnit(declFile.fileName, declInputFiles) && !findUnit(declFile.fileName, declOtherFiles)) { - dtsFiles.push({ unitName: declFile.fileName, content: declFile.code }); + if (declFile && !findUnit(declFile.file, declInputFiles) && !findUnit(declFile.file, declOtherFiles)) { + dtsFiles.push({ unitName: declFile.file, content: core.removeByteOrderMark(declFile.text) }); } } } @@ -1278,7 +1278,7 @@ namespace Harness { const outFile = options.outFile || options.out; if (!outFile) { if (options.outDir) { - let sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, result.currentDirectoryForProgram); + let sourceFilePath = ts.getNormalizedAbsolutePath(sourceFile.fileName, result.vfs.currentDirectory); sourceFilePath = sourceFilePath.replace(result.program.getCommonSourceDirectory(), ""); sourceFileName = ts.combinePaths(options.outDir, sourceFilePath); } @@ -1293,7 +1293,7 @@ namespace Harness { const dTsFileName = ts.removeFileExtension(sourceFileName) + ts.Extension.Dts; - return ts.forEach(result.declFilesCode, declFile => declFile.fileName === dTsFileName ? declFile : undefined); + return ts.forEach(result.declFilesCode, declFile => declFile.file === dTsFileName ? declFile : undefined); } function findUnit(fileName: string, units: TestFile[]) { @@ -1602,10 +1602,6 @@ namespace Harness { } } - function getByteOrderMarkText(file: Harness.Compiler.GeneratedFile): string { - return file.writeByteOrderMark ? "\u00EF\u00BB\u00BF" : ""; - } - export function doSourcemapBaseline(baselinePath: string, options: ts.CompilerOptions, result: compiler.CompilationResult, harnessSettings: Harness.TestCaseParser.CompilerSettings) { if (options.inlineSourceMap) { if (result.sourceMaps.length > 0) { @@ -1619,7 +1615,7 @@ namespace Harness { } Harness.Baseline.runBaseline(baselinePath.replace(/\.tsx?/, ".js.map"), () => { - if ((options.noEmitOnError && result.errors.length !== 0) || result.sourceMaps.length === 0) { + if ((options.noEmitOnError && result.diagnostics.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. /* tslint:disable:no-null-keyword */ @@ -1638,7 +1634,7 @@ namespace Harness { } export function doJsEmitBaseline(baselinePath: string, header: string, options: ts.CompilerOptions, result: compiler.CompilationResult, tsConfigFiles: ReadonlyArray, toBeCompiled: ReadonlyArray, otherFiles: ReadonlyArray, harnessSettings: Harness.TestCaseParser.CompilerSettings) { - if (!options.noEmit && result.files.length === 0 && result.errors.length === 0) { + if (!options.noEmit && result.files.length === 0 && result.diagnostics.length === 0) { throw new Error("Expected at least one js file to be emitted or at least one error to be created."); } @@ -1671,10 +1667,10 @@ namespace Harness { ); const declFileCompilationResult = Harness.Compiler.compileDeclarationFiles(declFileContext); - if (declFileCompilationResult && declFileCompilationResult.declResult.errors.length) { + if (declFileCompilationResult && declFileCompilationResult.declResult.diagnostics.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 += Harness.Compiler.getErrorBaseline(tsConfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.diagnostics); } if (jsCode.length > 0) { @@ -1688,12 +1684,12 @@ namespace Harness { }); } - function fileOutput(file: GeneratedFile, harnessSettings: Harness.TestCaseParser.CompilerSettings): string { - const fileName = harnessSettings.fullEmitPaths ? utils.removeTestPathPrefixes(file.fileName) : ts.getBaseFileName(file.fileName); - return "//// [" + fileName + "]\r\n" + getByteOrderMarkText(file) + utils.removeTestPathPrefixes(file.code); + function fileOutput(file: documents.TextDocument, harnessSettings: Harness.TestCaseParser.CompilerSettings): string { + const fileName = harnessSettings.fullEmitPaths ? utils.removeTestPathPrefixes(file.file) : ts.getBaseFileName(file.file); + return "//// [" + fileName + "]\r\n" + utils.removeTestPathPrefixes(file.text); } - export function collateOutputs(outputFiles: ReadonlyArray): string { + export function collateOutputs(outputFiles: ReadonlyArray): string { const gen = iterateOutputs(outputFiles); // Emit them let result = ""; @@ -1709,13 +1705,13 @@ namespace Harness { return result; } - export function *iterateOutputs(outputFiles: ReadonlyArray): IterableIterator<[string, string]> { + export function *iterateOutputs(outputFiles: ReadonlyArray): IterableIterator<[string, string]> { // Collect, test, and sort the fileNames - outputFiles.slice().sort((a, b) => ts.compareStringsCaseSensitive(cleanName(a.fileName), cleanName(b.fileName))); + outputFiles.slice().sort((a, b) => ts.compareStringsCaseSensitive(cleanName(a.file), cleanName(b.file))); const dupeCase = ts.createMap(); // Yield them for (const outputFile of outputFiles) { - yield [checkDuplicatedFileName(outputFile.fileName, dupeCase), "/*====== " + outputFile.fileName + " ======*/\r\n" + outputFile.code]; + yield [checkDuplicatedFileName(outputFile.file, dupeCase), "/*====== " + outputFile.file + " ======*/\r\n" + core.removeByteOrderMark(outputFile.text)]; } function cleanName(fn: string) { @@ -1745,12 +1741,6 @@ namespace Harness { } return path; } - - export interface GeneratedFile { - fileName: string; - code: string; - writeByteOrderMark: boolean; - } } export namespace TestCaseParser { diff --git a/src/harness/projectsRunner.ts b/src/harness/projectsRunner.ts index 73098ba3507b0..d8f670ba421d4 100644 --- a/src/harness/projectsRunner.ts +++ b/src/harness/projectsRunner.ts @@ -1,6 +1,7 @@ /// /// /// +/// // Test case is json of below type in tests/cases/project/ interface ProjectRunnerTestCase { @@ -20,10 +21,6 @@ interface ProjectRunnerTestCaseResolutionInfo extends ProjectRunnerTestCase { emittedFiles: ReadonlyArray; // List of files that were emitted by the compiler } -interface BatchCompileProjectTestCaseEmittedFile extends Harness.Compiler.GeneratedFile { - emittedFileName: string; -} - interface CompileProjectFilesResult { configFileSourceFiles: ReadonlyArray; moduleKind: ts.ModuleKind; @@ -34,7 +31,7 @@ interface CompileProjectFilesResult { } interface BatchCompileProjectTestCaseResult extends CompileProjectFilesResult { - outputFiles?: BatchCompileProjectTestCaseEmittedFile[]; + outputFiles?: ReadonlyArray; } class ProjectRunner extends RunnerBase { @@ -197,7 +194,7 @@ class ProjectRunner extends RunnerBase { function batchCompilerProjectTestCase(moduleKind: ts.ModuleKind): BatchCompileProjectTestCaseResult { let nonSubfolderDiskFiles = 0; - const outputFiles: BatchCompileProjectTestCaseEmittedFile[] = []; + const outputFiles: documents.TextDocument[] = []; let inputFiles = testCase.inputFiles; let compilerOptions = createCompilerOptions(); const configFileSourceFiles: ts.SourceFile[] = []; @@ -355,12 +352,15 @@ class ProjectRunner extends RunnerBase { ensureDirectoryStructure(ts.getDirectoryPath(ts.normalizePath(outputFilePath))); Harness.IO.writeFile(outputFilePath, data); - outputFiles.push({ emittedFileName: fileName, code: data, fileName: diskRelativeName, writeByteOrderMark }); + outputFiles.push(new documents.TextDocument( + diskRelativeName, + writeByteOrderMark ? core.addUTF8ByteOrderMark(data) : data, + new Map([["emittedFileName", fileName]]))); } } function compileCompileDTsFiles(compilerResult: BatchCompileProjectTestCaseResult) { - const allInputFiles: { emittedFileName: string; code: string; }[] = []; + const allInputFiles: documents.TextDocument[] = []; if (!compilerResult.program) { return; } @@ -368,7 +368,10 @@ class ProjectRunner extends RunnerBase { ts.forEach(compilerResult.program.getSourceFiles(), sourceFile => { if (sourceFile.isDeclarationFile) { - allInputFiles.unshift({ emittedFileName: sourceFile.fileName, code: sourceFile.text }); + allInputFiles.unshift(new documents.TextDocument( + sourceFile.fileName, + sourceFile.text, + new Map([["emittedFileName", sourceFile.fileName]]))); } else if (!(compilerOptions.outFile || compilerOptions.out)) { let emitOutputFilePathWithoutExtension: string = undefined; @@ -400,19 +403,19 @@ class ProjectRunner extends RunnerBase { return compileProjectFiles(compilerResult.moduleKind, compilerResult.configFileSourceFiles, getInputFiles, getSourceFileText, /*writeFile*/ ts.noop, compilerResult.compilerOptions); function findOutputDtsFile(fileName: string) { - return ts.forEach(compilerResult.outputFiles, outputFile => outputFile.emittedFileName === fileName ? outputFile : undefined); + return ts.forEach(compilerResult.outputFiles, outputFile => outputFile.meta.get("emittedFileName") === fileName ? outputFile : undefined); } function getInputFiles() { - return ts.map(allInputFiles, outputFile => outputFile.emittedFileName); + return ts.map(allInputFiles, outputFile => outputFile.meta.get("emittedFileName")); } function getSourceFileText(fileName: string): string { for (const inputFile of allInputFiles) { const isMatchingFile = ts.isRootedDiskPath(fileName) - ? ts.getNormalizedAbsolutePath(inputFile.emittedFileName, getCurrentDirectory()) === fileName - : inputFile.emittedFileName === fileName; + ? ts.getNormalizedAbsolutePath(inputFile.meta.get("emittedFileName"), getCurrentDirectory()) === fileName + : inputFile.meta.get("emittedFileName") === fileName; if (isMatchingFile) { - return inputFile.code; + return core.removeByteOrderMark(inputFile.text); } } return undefined; @@ -452,7 +455,7 @@ class ProjectRunner extends RunnerBase { return ts.convertToRelativePath(inputFile.fileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); }); resolutionInfo.emittedFiles = ts.map(compilerResult.outputFiles, outputFile => { - return ts.convertToRelativePath(outputFile.emittedFileName, getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); + return ts.convertToRelativePath(outputFile.meta.get("emittedFileName"), getCurrentDirectory(), path => Harness.Compiler.getCanonicalFileName(path)); }); return resolutionInfo; } @@ -484,9 +487,9 @@ class ProjectRunner extends RunnerBase { // There may be multiple files with different baselines. Run all and report at the end, else // it stops copying the remaining emitted files from 'local/projectOutput' to 'local/project'. try { - Harness.Baseline.runBaseline(getBaselineFolder(compilerResult.moduleKind) + outputFile.fileName, () => { + Harness.Baseline.runBaseline(getBaselineFolder(compilerResult.moduleKind) + outputFile.file, () => { try { - return Harness.IO.readFile(getProjectOutputFolder(outputFile.fileName, compilerResult.moduleKind)); + return Harness.IO.readFile(getProjectOutputFolder(outputFile.file, compilerResult.moduleKind)); } catch (e) { return undefined; diff --git a/src/harness/rwcRunner.ts b/src/harness/rwcRunner.ts index 16beb92a54787..86b4419971ddf 100644 --- a/src/harness/rwcRunner.ts +++ b/src/harness/rwcRunner.ts @@ -197,12 +197,12 @@ namespace RWC { it("has the expected errors", () => { Harness.Baseline.runMultifileBaseline(baseName, ".errors.txt", () => { - if (compilerResult.errors.length === 0) { + if (compilerResult.diagnostics.length === 0) { return null; } // Do not include the library in the baselines to avoid noise const baselineFiles = tsconfigFiles.concat(inputFiles, otherFiles).filter(f => !Harness.isDefaultLibraryFile(f.unitName)); - const errors = compilerResult.errors.filter(e => !e.file || !Harness.isDefaultLibraryFile(e.file.fileName)); + const errors = compilerResult.diagnostics.filter(e => !e.file || !Harness.isDefaultLibraryFile(e.file.fileName)); return Harness.Compiler.iterateErrorBaseline(baselineFiles, errors); }, baselineOpts); }); @@ -210,9 +210,9 @@ namespace RWC { // Ideally, a generated declaration file will have no errors. But we allow generated // declaration file errors as part of the baseline. it("has the expected errors in generated declaration files", () => { - if (compilerOptions.declaration && !compilerResult.errors.length) { + if (compilerOptions.declaration && !compilerResult.diagnostics.length) { Harness.Baseline.runMultifileBaseline(baseName, ".dts.errors.txt", () => { - if (compilerResult.errors.length === 0) { + if (compilerResult.diagnostics.length === 0) { return null; } @@ -223,7 +223,7 @@ namespace RWC { compilerResult = undefined; const declFileCompilationResult = Harness.Compiler.compileDeclarationFiles(declContext); - return Harness.Compiler.iterateErrorBaseline(tsconfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.errors); + return Harness.Compiler.iterateErrorBaseline(tsconfigFiles.concat(declFileCompilationResult.declInputFiles, declFileCompilationResult.declOtherFiles), declFileCompilationResult.declResult.diagnostics); }, baselineOpts); } }); diff --git a/src/harness/sourceMapRecorder.ts b/src/harness/sourceMapRecorder.ts index 330ac1743ac9b..4838fcd149f76 100644 --- a/src/harness/sourceMapRecorder.ts +++ b/src/harness/sourceMapRecorder.ts @@ -206,8 +206,8 @@ namespace Harness.SourceMapRecorder { let sourceMapSources: string[]; let sourceMapNames: string[]; - let jsFile: Compiler.GeneratedFile; - let jsLineMap: number[]; + let jsFile: documents.TextDocument; + let jsLineMap: ReadonlyArray; let tsCode: string; let tsLineMap: number[]; @@ -216,13 +216,13 @@ namespace Harness.SourceMapRecorder { let prevWrittenJsLine: number; let spanMarkerContinues: boolean; - export function initializeSourceMapSpanWriter(sourceMapRecordWriter: Compiler.WriterAggregator, sourceMapData: ts.SourceMapData, currentJsFile: Compiler.GeneratedFile) { + export function initializeSourceMapSpanWriter(sourceMapRecordWriter: Compiler.WriterAggregator, sourceMapData: ts.SourceMapData, currentJsFile: documents.TextDocument) { sourceMapRecorder = sourceMapRecordWriter; sourceMapSources = sourceMapData.sourceMapSources; sourceMapNames = sourceMapData.sourceMapNames; jsFile = currentJsFile; - jsLineMap = ts.computeLineStarts(jsFile.code); + jsLineMap = jsFile.lineStarts; spansOnSingleLine = []; prevWrittenSourcePos = 0; @@ -290,7 +290,7 @@ namespace Harness.SourceMapRecorder { assert.isTrue(spansOnSingleLine.length === 1); sourceMapRecorder.WriteLine("-------------------------------------------------------------------"); - sourceMapRecorder.WriteLine("emittedFile:" + jsFile.fileName); + sourceMapRecorder.WriteLine("emittedFile:" + jsFile.file); sourceMapRecorder.WriteLine("sourceFile:" + sourceMapSources[spansOnSingleLine[0].sourceMapSpan.sourceIndex]); sourceMapRecorder.WriteLine("-------------------------------------------------------------------"); @@ -313,15 +313,16 @@ namespace Harness.SourceMapRecorder { writeJsFileLines(jsLineMap.length); } - function getTextOfLine(line: number, lineMap: number[], code: string) { + function getTextOfLine(line: number, lineMap: ReadonlyArray, code: string) { const startPos = lineMap[line]; const endPos = lineMap[line + 1]; - return code.substring(startPos, endPos); + const text = code.substring(startPos, endPos); + return line === 0 ? core.removeByteOrderMark(text) : text; } function writeJsFileLines(endJsLine: number) { for (; prevWrittenJsLine < endJsLine; prevWrittenJsLine++) { - sourceMapRecorder.Write(">>>" + getTextOfLine(prevWrittenJsLine, jsLineMap, jsFile.code)); + sourceMapRecorder.Write(">>>" + getTextOfLine(prevWrittenJsLine, jsLineMap, jsFile.text)); } } @@ -417,7 +418,7 @@ namespace Harness.SourceMapRecorder { // Emit markers iterateSpans(writeSourceMapMarker); - const jsFileText = getTextOfLine(currentJsLine, jsLineMap, jsFile.code); + const jsFileText = getTextOfLine(currentJsLine, jsLineMap, jsFile.text); if (prevEmittedCol < jsFileText.length) { // There is remaining text on this line that will be part of next source span so write marker that continues writeSourceMapMarker(/*currentSpan*/ undefined, spansOnSingleLine.length, /*endColumn*/ jsFileText.length, /*endContinues*/ true); @@ -434,7 +435,7 @@ namespace Harness.SourceMapRecorder { } } - export function getSourceMapRecord(sourceMapDataList: ReadonlyArray, program: ts.Program, jsFiles: ReadonlyArray) { + export function getSourceMapRecord(sourceMapDataList: ReadonlyArray, program: ts.Program, jsFiles: ReadonlyArray) { const sourceMapRecorder = new Compiler.WriterAggregator(); for (let i = 0; i < sourceMapDataList.length; i++) { diff --git a/src/harness/test262Runner.ts b/src/harness/test262Runner.ts index 0d32d2f251328..e3dae7e55baa4 100644 --- a/src/harness/test262Runner.ts +++ b/src/harness/test262Runner.ts @@ -68,14 +68,14 @@ class Test262BaselineRunner extends RunnerBase { it("has the expected emitted code", () => { Harness.Baseline.runBaseline(testState.filename + ".output.js", () => { - const files = testState.compilerResult.files.filter(f => f.fileName !== Test262BaselineRunner.helpersFilePath); + const files = testState.compilerResult.files.filter(f => f.file !== Test262BaselineRunner.helpersFilePath); return Harness.Compiler.collateOutputs(files); }, Test262BaselineRunner.baselineOptions); }); it("has the expected errors", () => { Harness.Baseline.runBaseline(testState.filename + ".errors.txt", () => { - const errors = testState.compilerResult.errors; + const errors = testState.compilerResult.diagnostics; if (errors.length === 0) { return null; } diff --git a/src/harness/unittests/publicApi.ts b/src/harness/unittests/publicApi.ts index 35acfec57f530..ba9672d54add0 100644 --- a/src/harness/unittests/publicApi.ts +++ b/src/harness/unittests/publicApi.ts @@ -20,7 +20,7 @@ describe("Public APIs", () => { }; const inputFiles = [testFile]; const output = Harness.Compiler.compileFiles(inputFiles, [], /*harnessSettings*/ undefined, /*options*/ {}, /*currentDirectory*/ undefined); - assert(!output.result.errors || !output.result.errors.length, Harness.Compiler.minimalDiagnosticsToString(output.result.errors, /*pretty*/ true)); + assert(!output.result.diagnostics || !output.result.diagnostics.length, Harness.Compiler.minimalDiagnosticsToString(output.result.diagnostics, /*pretty*/ true)); }); } From 4fbc74ec2615be13cc541fbbcf91fd8fdfdad855 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Sun, 12 Nov 2017 16:23:08 -0800 Subject: [PATCH 12/54] Partial deprecation of non-vfs TestServerHost --- src/harness/core.ts | 72 ++++ src/harness/mocks.ts | 339 +++++++++++++++ src/harness/tsconfig.json | 5 +- .../unittests/reuseProgramStructure.ts | 137 +++--- src/harness/unittests/tscWatchMode.ts | 10 +- src/harness/vfs.ts | 396 +++++++++++++++--- src/harness/virtualFileSystemWithWatch.ts | 8 +- .../conformance/types/never/neverInference.ts | 2 +- 8 files changed, 811 insertions(+), 158 deletions(-) create mode 100644 src/harness/mocks.ts diff --git a/src/harness/core.ts b/src/harness/core.ts index c4f3a7878162a..10e5bb7a11b8a 100644 --- a/src/harness/core.ts +++ b/src/harness/core.ts @@ -479,4 +479,76 @@ namespace core { splitLinesWorker(text, lineStarts, /*lines*/ undefined, /*removeEmptyElements*/ false); return lineStarts; } + + // + // Cryptography + // + + const H = new Uint32Array(5); + const W = new Uint8Array(80); + const B = new Uint8Array(64); + const BLOCK_SIZE = 64; + + export function sha1(message: string): string { + let buffer = B; + const textSize = message.length; + const messageSize = textSize * 2; + const finalBlockSize = messageSize % BLOCK_SIZE; + const padSize = (finalBlockSize < BLOCK_SIZE - 8 - 1 ? BLOCK_SIZE : BLOCK_SIZE * 2) - finalBlockSize; + const byteLength = messageSize + padSize; + if (byteLength > BLOCK_SIZE) { + buffer = new Uint8Array(byteLength); + } + + const bufferView = new DataView(buffer.buffer); + for (let i = 0; i < textSize; ++i) { + bufferView.setUint16(i * 2, message.charCodeAt(i)); + } + + buffer[messageSize] = 0x80; + bufferView.setUint32(byteLength - 4, messageSize * 8); + H[0] = 0x67452301, H[1] = 0xefcdab89, H[2] = 0x98badcfe, H[3] = 0x10325476, H[4] = 0xc3d2e1f0; + for (let offset = 0; offset < byteLength; offset += BLOCK_SIZE) { + let a = H[0], b = H[1], c = H[2], d = H[3], e = H[4]; + for (let i = 0; i < 80; ++i) { + if (i < 16) { + const x = offset + i * 4; + W[i] = buffer[x] << 24 | buffer[x + 1] << 16 | buffer[x + 2] << 8 | buffer[x + 3]; + } + else { + const x = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (x << 1 | x >>> 31) >>> 0; + } + + let t = (a << 5 | a >>> 27) >>> 0 + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5A827999; + } + else if (i < 40) { + t += (b ^ c ^ d) + 0x6ED9EBA1; + } + else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) + 0x8F1BBCDC; + } + else { + t += (b ^ c ^ d) + 0xCA62C1D6; + } + + e = d, d = c, c = (b << 30 | b >>> 2) >>> 0, b = a, a = t; + } + + H[0] += a, H[1] += b, H[2] += c, H[3] += d, H[4] += e; + } + + for (let i = 0; i < 5; ++i) { + bufferView.setUint32(i * 4, H[i]); + } + + let result = ""; + for (let i = 0; i < 20; ++i) { + result += (buffer[i] < 16 ? "0" : "") + buffer[i].toString(16); + } + + return result; + } } \ No newline at end of file diff --git a/src/harness/mocks.ts b/src/harness/mocks.ts new file mode 100644 index 0000000000000..051fdc094a495 --- /dev/null +++ b/src/harness/mocks.ts @@ -0,0 +1,339 @@ +/// +/// + +// NOTE: The contents of this file are all exported from the namespace 'mocks'. This is to +// support the eventual conversion of harness into a modular system. + +namespace mocks { + const MAX_INT32 = 2 ** 31 - 1; + + export interface Immediate { + readonly kind: "immediate"; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; + } + + export interface Timeout { + readonly kind: "timeout"; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; + readonly due: number; + } + + export interface Interval { + readonly kind: "interval"; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; + readonly due: number; + readonly interval: number; + } + + export type Timer = Immediate | Timeout | Interval; + + interface InternalInterval extends Interval { + due: number; + } + + /** + * Programmatic control over timers. + */ + export class Timers { + public static readonly MAX_DEPTH = MAX_INT32; + private _immediates = new Set(); + private _timeouts = new Set(); + private _intervals = new Set(); + private _time: number; + + constructor(startTime = Date.now()) { + this._time = startTime; + + // bind each timer method so that it can be detached from this instance. + this.setImmediate = this.setImmediate.bind(this); + this.clearImmedate = this.clearImmedate.bind(this); + this.setTimeout = this.setTimeout.bind(this); + this.clearTimeout = this.clearImmedate.bind(this); + this.setInterval = this.setInterval.bind(this); + this.clearInterval = this.clearInterval.bind(this); + } + + /** + * Get the current time. + */ + public get time(): number { + return this._time; + } + + public getPending(kind: "immediate", ms?: number): Immediate[]; + public getPending(kind: "timeout", ms?: number): Timeout[]; + public getPending(kind: "interval", ms?: number): Interval[]; + public getPending(kind?: Timer["kind"], ms?: number): Timer[]; + public getPending(kind?: Timer["kind"], ms = 0) { + if (ms < 0) throw new TypeError("Argument 'ms' out of range."); + const pending: Timer[] = []; + if (!kind || kind === "immediate") this.appendImmediates(pending); + if (!kind || kind === "timeout") this.appendDueTimeouts(pending, this._time + ms); + if (!kind || kind === "interval") this.appendDueIntervals(pending, this._time + ms, /*expand*/ false); + return core.stableSort(pending, compareTimers); + } + + /** + * Advance the current time and trigger callbacks, returning the number of callbacks triggered. + * @param ms The number of milliseconds to advance. + * @param maxDepth The maximum depth for nested `setImmediate` calls to continue processing. + * - Use `0` (default) to disable processing of nested `setImmediate` calls. + * - Use `Timer.NO_MAX_DEPTH` to continue processing all nested `setImmediate` calls. + */ + public advance(ms: number, maxDepth = 0): number { + if (ms < 0) throw new TypeError("Argument 'ms' out of range."); + if (maxDepth < 0) throw new TypeError("Argument 'maxDepth' out of range."); + this._time += ms; + return this.executePending(maxDepth); + } + + /** + * Execute any pending timers, returning the number of timers triggered. + * @param maxDepth The maximum depth for nested `setImmediate` calls to continue processing. + * - Use `0` (default) to disable processing of nested `setImmediate` calls. + * - Use `Timer.NO_MAX_DEPTH` to continue processing all nested `setImmediate` calls. + */ + public executePending(maxDepth = 0): number { + if (maxDepth < 0) throw new TypeError("Argument 'maxDepth' out of range."); + const pending: Timer[] = []; + this.appendImmediates(pending); + this.appendDueTimeouts(pending, this._time); + this.appendDueIntervals(pending, this._time, /*expand*/ true); + let count = this.execute(pending); + for (let depth = 0; depth < maxDepth && this._immediates.size > 0; depth++) { + pending.length = 0; + this.appendImmediates(pending); + count += this.execute(pending); + } + return count; + } + + public setImmediate(callback: (...args: any[]) => void, ...args: any[]): any { + const timer: Immediate = { kind: "immediate", callback, args }; + this._immediates.add(timer); + return timer; + } + + public clearImmedate(timerId: any): void { + this._immediates.delete(timerId); + } + + public setTimeout(callback: (...args: any[]) => void, timeout: number, ...args: any[]): any { + if (timeout < 0) timeout = 0; + const due = this._time + timeout; + const timer: Timeout = { kind: "timeout", callback, args, due }; + this._timeouts.add(timer); + return timer; + } + + public clearTimeout(timerId: any): void { + this._timeouts.delete(timerId); + } + + public setInterval(callback: (...args: any[]) => void, interval: number, ...args: any[]): any { + if (interval < 0) interval = 0; + const due = this._time + interval; + const timer: Interval = { kind: "interval", callback, args, due, interval }; + this._intervals.add(timer); + return timer; + } + + public clearInterval(timerId: any): void { + this._intervals.delete(timerId); + } + + private appendImmediates(pending: Timer[]) { + this._immediates.forEach(timer => { + pending.push(timer); + }); + } + + private appendDueTimeouts(timers: Timer[], dueTime: number) { + this._timeouts.forEach(timer => { + if (timer.due <= dueTime) { + timers.push(timer); + } + }); + } + + private appendDueIntervals(timers: Timer[], dueTime: number, expand: boolean) { + this._intervals.forEach(timer => { + while (timer.due <= dueTime) { + timers.push(timer); + if (!expand) break; + timer.due += timer.interval; + } + }); + } + + private execute(timers: Timer[]) { + for (const timer of core.stableSort(timers, compareTimers)) { + switch (timer.kind) { + case "immediate": this._immediates.delete(timer); break; + case "timeout": this._timeouts.delete(timer); break; + } + const { callback, args } = timer; + callback(...args); + } + return timers.length; + } + } + + function compareTimers(a: Immediate | Timeout, b: Immediate | Timeout) { + return (a.kind === "immediate" ? -1 : a.due) - (b.kind === "immediate" ? -1 : b.due); + } + + export class MockServerHost implements ts.server.ServerHost, ts.FormatDiagnosticsHost { + public readonly exitMessage = "System Exit"; + public readonly timers = new Timers(); + public readonly vfs: vfs.VirtualFileSystem; + public exitCode: number; + + private readonly _output: string[] = []; + private readonly _executingFilePath: string; + private readonly _getCanonicalFileName: (file: string) => string; + + constructor(vfs: vfs.VirtualFileSystem, executingFilePath = "/.ts/tsc.js", newLine = "\n") { + this.vfs = vfs; + this.useCaseSensitiveFileNames = vfs.useCaseSensitiveFileNames; + this.newLine = newLine; + this._executingFilePath = executingFilePath; + this._getCanonicalFileName = ts.createGetCanonicalFileName(this.useCaseSensitiveFileNames); + } + + // #region DirectoryStructureHost members + public readonly newLine: string; + public readonly useCaseSensitiveFileNames: boolean; + + public write(message: string) { + this._output.push(message); + } + + public readFile(path: string) { + return this.vfs.readFile(path); + } + + public writeFile(path: string, data: string): void { + this.vfs.writeFile(path, data); + } + + public fileExists(path: string) { + return this.vfs.fileExists(path); + } + + public directoryExists(path: string) { + return this.vfs.directoryExists(path); + } + + public createDirectory(path: string): void { + this.vfs.addDirectory(path); + } + + public getCurrentDirectory() { + return this.vfs.currentDirectory; + } + + public getDirectories(path: string) { + return this.vfs.getDirectoryNames(path); + } + + public readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[] { + return ts.matchFiles(path, extensions, exclude, include, this.useCaseSensitiveFileNames, this.vfs.currentDirectory, depth, path => { + return this.vfs.getAccessibleFileSystemEntries(path); + }); + } + + public exit(exitCode?: number) { + this.exitCode = exitCode; + throw new Error("System exit"); + } + // #endregion DirectoryStructureHost members + + // #region System members + public readonly args: string[] = []; + + public getFileSize(path: string) { + const stats = this.vfs.getStats(path); + return stats && stats.isFile() ? stats.size : 0; + } + + public watchFile(path: string, cb: ts.FileWatcherCallback) { + return this.vfs.watchFile(path, (path, change) => { + cb(path, change === "added" ? ts.FileWatcherEventKind.Created : + change === "removed" ? ts.FileWatcherEventKind.Deleted : + ts.FileWatcherEventKind.Changed); + }); + } + + public watchDirectory(path: string, cb: ts.DirectoryWatcherCallback, recursive: boolean): ts.FileWatcher { + return this.vfs.watchDirectory(path, cb, recursive); + } + + public resolvePath(path: string) { + return vpath.resolve(this.vfs.currentDirectory, path); + } + + public getExecutingFilePath() { + return this._executingFilePath; + } + + public getModifiedTime(path: string) { + const stats = this.vfs.getStats(path); + return stats && stats.mtime; + } + + public createHash(data: string): string { + return core.sha1(data); + } + + public realpath(path: string) { + const entry = this.vfs.getRealEntry(this.vfs.getEntry(path)); + return entry && entry.path; + } + + public getEnvironmentVariable(_name: string): string | undefined { + return undefined; + } + + // TOOD: record and invoke callbacks to simulate timer events + public setTimeout(callback: (...args: any[]) => void, timeout: number, ...args: any[]) { + return this.timers.setTimeout(callback, timeout, ...args); + } + + public clearTimeout(timeoutId: any): void { + this.timers.clearTimeout(timeoutId); + } + // #endregion System members + + // #region FormatDiagnosticsHost members + public getNewLine() { + return this.newLine; + } + + public getCanonicalFileName(fileName: string) { + return this._getCanonicalFileName(fileName); + } + // #endregion FormatDiagnosticsHost members + + // #region ServerHost members + public setImmediate(callback: (...args: any[]) => void, ...args: any[]): any { + return this.timers.setImmediate(callback, args); + } + + public clearImmediate(timeoutId: any): void { + this.timers.clearImmedate(timeoutId); + } + // #endregion ServerHost members + + public getOutput(): ReadonlyArray { + return this._output; + } + + public clearOutput() { + this._output.length = 0; + } + } +} \ No newline at end of file diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index ee0032e121835..11e03438090ae 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -73,7 +73,7 @@ "../services/codefixes/disableJsDiagnostics.ts", "harness.ts", - + "core.ts", "utils.ts", "events.ts", @@ -81,7 +81,8 @@ "vpath.ts", "vfs.ts", "compiler.ts", - + "mocks.ts", + "virtualFileSystemWithWatch.ts", "sourceMapRecorder.ts", "harnessLanguageService.ts", diff --git a/src/harness/unittests/reuseProgramStructure.ts b/src/harness/unittests/reuseProgramStructure.ts index fdccc8a7795f1..7e61f188b10c0 100644 --- a/src/harness/unittests/reuseProgramStructure.ts +++ b/src/harness/unittests/reuseProgramStructure.ts @@ -871,9 +871,6 @@ namespace ts { }); }); - import TestSystem = ts.TestFSWithWatch.TestServerHost; - type FileOrFolder = ts.TestFSWithWatch.FileOrFolder; - import createTestSystem = ts.TestFSWithWatch.createWatchedSystem; import libFile = ts.TestFSWithWatch.libFile; describe("isProgramUptoDate should return true when there is no change in compiler options and", () => { @@ -897,7 +894,7 @@ namespace ts { return JSON.parse(JSON.stringify(filesOrOptions)); } - function createWatchingSystemHost(host: TestSystem) { + function createWatchingSystemHost(host: ts.System) { return ts.createWatchingSystemHost(/*pretty*/ undefined, host); } @@ -917,48 +914,29 @@ namespace ts { verifyProgramIsUptoDate(program, fileNames, options); } - function verifyProgram(files: FileOrFolder[], rootFiles: string[], options: CompilerOptions, configFile: string) { - const watchingSystemHost = createWatchingSystemHost(createTestSystem(files)); + function verifyProgram(vfs: vfs.VirtualFileSystem, rootFiles: string[], options: CompilerOptions, configFile: string) { + const watchingSystemHost = createWatchingSystemHost(new mocks.MockServerHost(vfs)); verifyProgramWithoutConfigFile(watchingSystemHost, rootFiles, options); verifyProgramWithConfigFile(watchingSystemHost, configFile); } it("has empty options", () => { - const file1: FileOrFolder = { - path: "/a/b/file1.ts", - content: "let x = 1" - }; - const file2: FileOrFolder = { - path: "/a/b/file2.ts", - content: "let y = 1" - }; - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: "{}" - }; - verifyProgram([file1, file2, libFile, configFile], [file1.path, file2.path], {}, configFile.path); + const fs = new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true); + const file1 = fs.addFile("/a/b/file1.ts", "let x = 1"); + const file2 = fs.addFile("/a/b/file2.ts", "let y = 1"); + const configFile = fs.addFile("/a/b/tsconfig.json", "{}"); + fs.addFile(libFile.path, libFile.content); + verifyProgram(fs, [file1.path, file2.path], {}, configFile.path); }); it("has lib specified in the options", () => { const compilerOptions: CompilerOptions = { lib: ["es5", "es2015.promise"] }; - const app: FileOrFolder = { - path: "/src/app.ts", - content: "var x: Promise;" - }; - const configFile: FileOrFolder = { - path: "/src/tsconfig.json", - content: JSON.stringify({ compilerOptions }) - }; - const es5Lib: FileOrFolder = { - path: "/compiler/lib.es5.d.ts", - content: "declare const eval: any" - }; - const es2015Promise: FileOrFolder = { - path: "/compiler/lib.es2015.promise.d.ts", - content: "declare class Promise {}" - }; - - verifyProgram([app, configFile, es5Lib, es2015Promise], [app.path], compilerOptions, configFile.path); + const fs = new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true); + const app = fs.addFile("/src/app.ts", "var x: Promise;"); + const configFile = fs.addFile("/src/tsconfig.json", JSON.stringify({ compilerOptions })); + fs.addFile("/compiler/lib.es5.d.ts", "declare const eval: any;"); + fs.addFile("/compiler/lib.es2015.promise.d.ts", "declare class Promise {}"); + verifyProgram(fs, [app.path], compilerOptions, configFile.path); }); it("has paths specified in the options", () => { @@ -972,31 +950,23 @@ namespace ts { ] } }; - const app: FileOrFolder = { - path: "/src/packages/framework/app.ts", - content: 'import classc from "module1/lib/file1";\ - import classD from "module3/file3";\ - let x = new classc();\ - let y = new classD();' - }; - const module1: FileOrFolder = { - path: "/src/packages/mail/data/module1/lib/file1.ts", - content: 'import classc from "module2/file2";export default classc;', - }; - const module2: FileOrFolder = { - path: "/src/packages/mail/data/module1/lib/module2/file2.ts", - content: 'class classc { method2() { return "hello"; } }\nexport default classc', - }; - const module3: FileOrFolder = { - path: "/src/packages/styles/module3/file3.ts", - content: "class classD { method() { return 10; } }\nexport default classD;" - }; - const configFile: FileOrFolder = { - path: "/src/tsconfig.json", - content: JSON.stringify({ compilerOptions }) - }; - - verifyProgram([app, module1, module2, module3, libFile, configFile], [app.path], compilerOptions, configFile.path); + const fs = new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true); + const app = fs.addFile("/src/packages/framework/app.ts", + `import classC from "module1/lib/file1";\n` + + `import classD from "module3/file3";\n` + + `let x = new classC();\n` + + `let y = new classD();`); + fs.addFile("/src/packages/mail/data/module1/lib/file1.ts", + `import classC from "module2/file2";\n` + + `export default classC;`); + fs.addFile("/src/packages/mail/data/module1/lib/module2/file2.ts", + `class classC { method2() { return "hello"; } }\n` + + `export default classC;`); + fs.addFile("/src/packages/styles/module3/file3.ts", + `class classD { method() { return 10; } }\n` + + `export default classD;`); + const configFile = fs.addFile("/src/tsconfig.json", JSON.stringify({ compilerOptions })); + verifyProgram(fs, [app.path], compilerOptions, configFile.path); }); it("has include paths specified in tsconfig file", () => { @@ -1010,31 +980,24 @@ namespace ts { ] } }; - const app: FileOrFolder = { - path: "/src/packages/framework/app.ts", - content: 'import classc from "module1/lib/file1";\ - import classD from "module3/file3";\ - let x = new classc();\ - let y = new classD();' - }; - const module1: FileOrFolder = { - path: "/src/packages/mail/data/module1/lib/file1.ts", - content: 'import classc from "module2/file2";export default classc;', - }; - const module2: FileOrFolder = { - path: "/src/packages/mail/data/module1/lib/module2/file2.ts", - content: 'class classc { method2() { return "hello"; } }\nexport default classc', - }; - const module3: FileOrFolder = { - path: "/src/packages/styles/module3/file3.ts", - content: "class classD { method() { return 10; } }\nexport default classD;" - }; - const configFile: FileOrFolder = { - path: "/src/tsconfig.json", - content: JSON.stringify({ compilerOptions, include: ["packages/**/ *.ts"] }) - }; - - const watchingSystemHost = createWatchingSystemHost(createTestSystem([app, module1, module2, module3, libFile, configFile])); + const fs = new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true); + fs.addFile("/src/packages/framework/app.ts", + `import classC from "module1/lib/file1";\n` + + `import classD from "module3/file3";\n` + + `let x = new classC();\n` + + `let y = new classD();`); + fs.addFile("/src/packages/mail/data/module1/lib/file1.ts", + `import classC from "module2/file2";\n` + + `export default classC;`); + fs.addFile("/src/packages/mail/data/module1/lib/module2/file2.ts", + `class classC { method2() { return "hello"; } }\n` + + `export default classC;`); + fs.addFile("/src/packages/styles/module3/file3.ts", + `class classD { method() { return 10; } }\n` + + `export default classD;`); + const configFile = fs.addFile("/src/tsconfig.json", + JSON.stringify({ compilerOptions, include: ["packages/**/ *.ts"] })); + const watchingSystemHost = createWatchingSystemHost(new mocks.MockServerHost(fs)); verifyProgramWithConfigFile(watchingSystemHost, configFile.path); }); }); diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 4e2d63cec90ea..e173df04abc3a 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -22,7 +22,7 @@ namespace ts.tscWatch { checkFileNames(`Program rootFileNames`, program.getRootFileNames(), expectedFiles); } - function createWatchingSystemHost(system: WatchedSystem) { + function createWatchingSystemHost(system: ts.System) { return ts.createWatchingSystemHost(/*pretty*/ undefined, system); } @@ -30,22 +30,22 @@ namespace ts.tscWatch { return ts.parseConfigFile(configFileName, {}, watchingSystemHost.system, watchingSystemHost.reportDiagnostic, watchingSystemHost.reportWatchDiagnostic); } - function createWatchModeWithConfigFile(configFilePath: string, host: WatchedSystem) { + function createWatchModeWithConfigFile(configFilePath: string, host: ts.System) { const watchingSystemHost = createWatchingSystemHost(host); const configFileResult = parseConfigFile(configFilePath, watchingSystemHost); return ts.createWatchModeWithConfigFile(configFileResult, {}, watchingSystemHost); } - function createWatchModeWithoutConfigFile(fileNames: string[], host: WatchedSystem, options: CompilerOptions = {}) { + function createWatchModeWithoutConfigFile(fileNames: string[], host: ts.System, options: CompilerOptions = {}) { const watchingSystemHost = createWatchingSystemHost(host); return ts.createWatchModeWithoutConfigFile(fileNames, options, watchingSystemHost); } - function getEmittedLineForMultiFileOutput(file: FileOrFolder, host: WatchedSystem) { + function getEmittedLineForMultiFileOutput(file: FileOrFolder, host: ts.System) { return `TSFILE: ${file.path.replace(".ts", ".js")}${host.newLine}`; } - function getEmittedLineForSingleFileOutput(filename: string, host: WatchedSystem) { + function getEmittedLineForSingleFileOutput(filename: string, host: ts.System) { return `TSFILE: ${filename}${host.newLine}`; } diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index 7d31ae3df96b3..0fcaef05443ee 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -9,6 +9,11 @@ // support the eventual conversion of harness into a modular system. namespace vfs { + const S_IFMT = 0xf000; + const S_IFLNK = 0xa000; + const S_IFREG = 0x8000; + const S_IFDIR = 0x4000; + export interface PathMappings { [path: string]: string; } @@ -348,7 +353,7 @@ namespace vfs { */ public readFile(path: string): string | undefined { const file = this.getFile(vpath.resolve(this.currentDirectory, path)); - return file && file.content; + return file && file.readContent(); } /** @@ -357,9 +362,7 @@ namespace vfs { public writeFile(path: string, content: string): void { path = vpath.resolve(this.currentDirectory, path); const file = this.getFile(path) || this.addFile(path); - if (file) { - file.content = content; - } + if (file) file.writeContent(content); } /** @@ -376,6 +379,35 @@ namespace vfs { return this.getEntry(path) instanceof VirtualFile; } + public rename(oldpath: string, newpath: string) { + oldpath = vpath.resolve(this.currentDirectory, oldpath); + newpath = vpath.resolve(this.currentDirectory, newpath); + return this.root.replaceEntry(newpath, this.getEntry(oldpath)); + } + + /** + * Get file stats + */ + public getStats(path: string, options?: { noFollowSymlinks?: boolean }) { + let entry = this.getEntry(path); + if (entry && !(options && options.noFollowSymlinks)) { + entry = this.getRealEntry(entry); + } + return entry && entry.getStats(); + } + + public setStats(path: string, atime: number | Date, mtime: number | Date, options?: { noFollowSymlinks?: boolean }) { + let entry = this.getEntry(path); + if (entry && !(options && options.noFollowSymlinks)) { + entry = this.getRealEntry(entry); + } + if (entry && !entry.isReadOnly) { + entry.setStats(atime, mtime); + return true; + } + return false; + } + /** * If an entry is a symbolic link, gets the resolved target of the link. Otherwise, returns the entry. */ @@ -425,6 +457,39 @@ namespace vfs { return this.root.getDirectory(vpath.resolve(this.currentDirectory, path), options); } + public getEntries(path: string, options: { recursive?: boolean, pattern?: RegExp, kind: "file" }): VirtualFile[]; + public getEntries(path: string, options: { recursive?: boolean, pattern?: RegExp, kind: "directory" }): VirtualDirectory[]; + public getEntries(path: string, options?: { recursive?: boolean, pattern?: RegExp, kind?: "file" | "directory" }): VirtualEntry[]; + public getEntries(path: string, options?: { recursive?: boolean, pattern?: RegExp, kind?: "file" | "directory" }) { + const dir = this.root.getDirectory(vpath.resolve(this.currentDirectory, path)); + return dir ? dir.getEntries(options) : []; + } + + public getDirectories(path: string, options?: { recursive?: boolean, pattern?: RegExp }) { + const dir = this.root.getDirectory(vpath.resolve(this.currentDirectory, path)); + return dir ? dir.getDirectories(options) : []; + } + + public getFiles(path: string, options?: { recursive?: boolean, pattern?: RegExp }) { + const dir = this.root.getDirectory(vpath.resolve(this.currentDirectory, path)); + return dir ? dir.getFiles(options) : []; + } + + public getEntryNames(path: string, options?: { recursive?: boolean, qualified?: boolean, pattern?: RegExp, kind?: "file" | "directory" }) { + const dir = this.root.getDirectory(vpath.resolve(this.currentDirectory, path)); + return dir ? dir.getEntryNames(options) : []; + } + + public getDirectoryNames(path: string, options?: { recursive?: boolean, qualified?: boolean, pattern?: RegExp }) { + const dir = this.root.getDirectory(vpath.resolve(this.currentDirectory, path)); + return dir ? dir.getDirectoryNames(options) : []; + } + + public getFileNames(path: string, options?: { recursive?: boolean, qualified?: boolean, pattern?: RegExp }) { + const dir = this.root.getDirectory(vpath.resolve(this.currentDirectory, path)); + return dir ? dir.getFileNames(options) : []; + } + /** * Gets the accessible file system entries from a path relative to the current directory. */ @@ -587,17 +652,29 @@ namespace vfs { } export abstract class VirtualFileSystemEntry extends VirtualFileSystemObject { + private static _nextId = 1; private _path: string; + private _name: string; + private _parent: VirtualDirectory | undefined; private _metadata: core.Metadata; + private _atimeMS: number = Date.now(); + private _mtimeMS: number = Date.now(); + private _ctimeMS: number = Date.now(); + private _birthtimeMS: number = Date.now(); + + public readonly id = VirtualFileSystemEntry._nextId++; + + constructor(parent: VirtualDirectory | undefined, name: string) { + super(); + this._parent = parent; + this._name = name; + } /** * Gets the name of this entry. */ - public readonly name: string; - - constructor(name: string) { - super(); - this.name = name; + public get name(): string { + return this._name; } /** @@ -608,10 +685,19 @@ namespace vfs { return this.parent.fileSystem; } + /** + * Gets the root directory for this entry. + */ + public get root(): VirtualDirectory | undefined { + return this.parent.root; + } + /** * Gets the parent directory for this entry. */ - public abstract get parent(): VirtualDirectory | undefined; + public get parent(): VirtualDirectory | undefined { + return this._parent; + } /** * Gets the entry that this entry shadows. @@ -665,6 +751,27 @@ namespace vfs { */ public abstract shadow(parent: VirtualDirectory): VirtualEntry; + public abstract getStats(): VirtualStats; + + public setStats(atime: number | Date, mtime: number | Date) { + this.writePreamble(); + this._atimeMS = typeof atime === "object" ? atime.getTime() : + atime < 0 ? Date.now() : + atime; + this._mtimeMS = typeof mtime === "object" ? mtime.getTime() : + mtime < 0 ? Date.now() : + mtime; + this._ctimeMS = Date.now(); + } + + protected static _setNameUnsafe(entry: VirtualFileSystemEntry, name: string) { + entry._name = name; + } + + protected static _setParentUnsafe(entry: VirtualFileSystemEntry, parent: VirtualDirectory) { + entry._parent = parent; + } + protected shadowPreamble(parent: VirtualDirectory): void { this.checkShadowParent(parent); this.checkShadowFileSystem(parent.fileSystem); @@ -681,6 +788,30 @@ namespace vfs { fileSystem = fileSystem.shadowRoot; } } + + protected getStatsCore(mode: number, size: number) { + return new VirtualStats( + this.root.id, + this.id, + mode, + size, + this._atimeMS, + this._mtimeMS, + this._ctimeMS, + this._birthtimeMS); + } + + protected updateAccessTime() { + if (!this.isReadOnly) { + this._atimeMS = Date.now(); + } + } + + protected updateModificationTime() { + if (!this.isReadOnly) { + this._mtimeMS = Date.now(); + } + } } export interface VirtualDirectory { @@ -721,15 +852,13 @@ namespace vfs { export class VirtualDirectory extends VirtualFileSystemEntry { protected _shadowRoot: VirtualDirectory | undefined; - private _parent: VirtualDirectory; private _entries: core.KeyedCollection | undefined; private _resolver: FileSystemResolver | undefined; private _onChildFileSystemChange: (path: string, change: FileSystemChange) => void; constructor(parent: VirtualDirectory | undefined, name: string, resolver?: FileSystemResolver) { - super(name); + super(parent, name); if (parent === undefined && !(this instanceof VirtualRoot)) throw new TypeError(); - this._parent = parent; this._entries = undefined; this._resolver = resolver; this._shadowRoot = undefined; @@ -737,10 +866,10 @@ namespace vfs { } /** - * Gets the container for this entry. + * Gets the root directory for this entry. */ - public get parent(): VirtualDirectory | undefined { - return this._parent; + public get root(): VirtualDirectory | undefined { + return this.parent instanceof VirtualRoot ? this : undefined; } /** @@ -911,7 +1040,6 @@ namespace vfs { * Adds a directory (and all intermediate directories) for a path relative to this directory. */ public addDirectory(path: string, resolver?: FileSystemResolver): VirtualDirectory | undefined { - this.writePreamble(); const components = this.parsePath(path); const directory = this.walkContainers(components, /*create*/ true); return directory && directory.addOwnDirectory(components[components.length - 1], resolver); @@ -921,7 +1049,6 @@ namespace vfs { * Adds a file (and all intermediate directories) for a path relative to this directory. */ public addFile(path: string, content?: FileSystemResolver | ContentResolver | string, options?: { overwrite?: boolean }): VirtualFile | undefined { - this.writePreamble(); const components = this.parsePath(path); const directory = this.walkContainers(components, /*create*/ true); return directory && directory.addOwnFile(components[components.length - 1], content, options); @@ -940,7 +1067,6 @@ namespace vfs { */ public addSymlink(path: string, target: string | VirtualEntry): VirtualSymlink | undefined; public addSymlink(path: string, target: string | VirtualEntry): VirtualSymlink | undefined { - this.writePreamble(); const targetEntry = typeof target === "string" ? this.fileSystem.getEntry(vpath.resolve(this.path, target)) : target; if (targetEntry === undefined) return undefined; const components = this.parsePath(path); @@ -952,7 +1078,6 @@ namespace vfs { * Removes a directory (and all of its contents) at a path relative to this directory. */ public removeDirectory(path: string): boolean { - this.writePreamble(); const components = this.parsePath(path); const directory = this.walkContainers(components, /*create*/ false); return directory ? directory.removeOwnDirectory(components[components.length - 1]) : false; @@ -962,13 +1087,17 @@ namespace vfs { * Removes a file at a path relative to this directory. */ public removeFile(path: string): boolean { - this.writePreamble(); - this.writePreamble(); const components = this.parsePath(path); const directory = this.walkContainers(components, /*create*/ false); return directory ? directory.removeOwnFile(components[components.length - 1]) : false; } + public replaceEntry(path: string, entry: VirtualEntry) { + const components = this.parsePath(path); + const directory = this.walkContainers(components, /*create*/ false); + return directory ? directory.replaceOwnEntry(components[components.length - 1], entry) : false; + } + /** * Creates a shadow copy of this directory. Changes made to the shadow do not affect * this directory. @@ -980,6 +1109,10 @@ namespace vfs { return shadow; } + public getStats() { + return super.getStatsCore(S_IFDIR, 0); + } + protected makeReadOnlyCore(): void { if (this._entries) { this._entries.forEach(entry => entry.makeReadOnly()); @@ -1026,69 +1159,97 @@ namespace vfs { return undefined; } + this.writePreamble(); const entry = new VirtualDirectory(this, name, resolver); - this.getOwnEntries().set(entry.name, entry); - this.emit("childAdded", entry); - entry.emit("fileSystemChange", entry.path, "added"); - entry.addListener("fileSystemChange", this._onChildFileSystemChange); + this.addOwnEntry(entry); return entry; } protected addOwnFile(name: string, content?: FileSystemResolver | ContentResolver | string, options: { overwrite?: boolean } = {}): VirtualFile | undefined { const existing = this.getOwnEntry(name); - if (existing) { - if (!options.overwrite || !(existing instanceof VirtualFile)) { - return undefined; - } + if (existing && (!options.overwrite || !(existing instanceof VirtualFile))) { + return undefined; + } + this.writePreamble(); + if (existing) { // Remove the existing entry this.getOwnEntries().delete(name); } const entry = new VirtualFile(this, name, content); - this.getOwnEntries().set(entry.name, entry); - this.emit("childAdded", entry); - entry.emit("fileSystemChange", entry.path, "added"); - entry.addListener("fileSystemChange", this._onChildFileSystemChange); + this.addOwnEntry(entry); return entry; } protected addOwnSymlink(name: string, target: VirtualEntry): VirtualSymlink | undefined { if (this.getOwnEntry(name)) return undefined; + this.writePreamble(); const entry = target instanceof VirtualFile ? new VirtualFileSymlink(this, name, target.path) : new VirtualDirectorySymlink(this, name, target.path); - this.getOwnEntries().set(entry.name, entry); - this.emit("childAdded", entry); - entry.emit("fileSystemChange", entry.path, "added"); - entry.addListener("fileSystemChange", this._onChildFileSystemChange); + this.addOwnEntry(entry); return entry; } protected removeOwnDirectory(name: string) { - const entries = this.getOwnEntries(); - const entry = entries.get(name); + const entry = this.getOwnEntries().get(name); if (entry instanceof VirtualDirectory) { - entries.delete(name); - this.emit("childRemoved", entry); - this.emit("fileSystemChange", entry.path, "removed"); - entry.removeListener("fileSystemChange", this._onChildFileSystemChange); + this.writePreamble(); + this.removeOwnEntry(entry); return true; } return false; } protected removeOwnFile(name: string) { - const entries = this.getOwnEntries(); - const entry = entries.get(name); + const entry = this.getOwnEntries().get(name); if (entry instanceof VirtualFile) { - entries.delete(name); - this.emit("childRemoved", entry); - this.emit("fileSystemChange", entry.path, "removed"); - entry.removeListener("fileSystemChange", this._onChildFileSystemChange); + this.writePreamble(); + this.removeOwnEntry(entry); return true; } return false; } + protected replaceOwnEntry(name: string, entry: VirtualEntry) { + const existing = this.getOwnEntry(name); + // cannot replace yourself + // cannot move a file or directory into a read-only container. + if (entry === existing || + this.isReadOnly) { + return false; + } + else if (entry instanceof VirtualDirectory) { + // cannot move a directory on top of a file. + // cannot move a directory on top of a non-empty directory. + // cannot move a directory if its parent is read-only + // cannot move a directory underneath itself. + if (existing instanceof VirtualFile || + existing instanceof VirtualDirectory && existing.getEntries().length > 0 || + entry.parent.isReadOnly || + vpath.beneath(entry.path, vpath.combine(this.path, name), !this.fileSystem.useCaseSensitiveFileNames)) { + return false; + } + } + else if (entry instanceof VirtualFile) { + // cannot move a file on top of a directory. + // cannot move a file if its parent is read-only. + if (existing instanceof VirtualDirectory || + entry.parent.isReadOnly) { + return false; + } + } + + // delete any existing file or directory + if (existing) this.removeOwnEntry(existing); + + // move and rename the entry + entry.parent.removeOwnEntry(entry); + VirtualFileSystemEntry._setNameUnsafe(entry, name); + VirtualFileSystemEntry._setParentUnsafe(entry, this); + this.addOwnEntry(entry); + return true; + } + private parsePath(path: string) { return vpath.parse(vpath.normalize(path)); } @@ -1126,6 +1287,25 @@ namespace vfs { return this.getOwnDirectory(name) || this.addOwnDirectory(name); } + private addOwnEntry(entry: VirtualEntry) { + this.getOwnEntries().set(entry.name, entry); + this.updateAccessTime(); + this.updateModificationTime(); + this.emit("childAdded", entry); + entry.emit("fileSystemChange", entry.path, "added"); + entry.addListener("fileSystemChange", this._onChildFileSystemChange); + } + + private removeOwnEntry(entry: VirtualEntry) { + const entries = this.getOwnEntries(); + entries.delete(entry.name); + this.updateAccessTime(); + this.updateModificationTime(); + this.emit("childRemoved", entry); + this.emit("fileSystemChange", entry.path, "removed"); + entry.removeListener("fileSystemChange", this._onChildFileSystemChange); + } + private onChildFileSystemChange(path: string, change: FileSystemChange) { this.emit("fileSystemChange", path, change); } @@ -1195,6 +1375,21 @@ namespace vfs { return shadow; } + public readTargetPath() { + const targetPath = this.targetPath; + if (targetPath) this.updateAccessTime(); + return targetPath; + } + + public writeTargetPath(targetPath: string) { + this.targetPath = targetPath; + if (targetPath) this.updateModificationTime(); + } + + public getStats() { + return super.getStatsCore(S_IFLNK, this.targetPath.length); + } + protected addOwnDirectory(name: string, resolver?: FileSystemResolver): VirtualDirectory | undefined { const target = this.target; const child = target && target.addDirectory(name, resolver); @@ -1338,6 +1533,10 @@ namespace vfs { return this._fileSystem; } + public get root(): VirtualDirectory | undefined { + return undefined; + } + public get path(): string { return ""; } @@ -1396,27 +1595,18 @@ namespace vfs { export class VirtualFile extends VirtualFileSystemEntry { protected _shadowRoot: VirtualFile | undefined; - private _parent: VirtualDirectory; private _content: string | undefined; private _contentWasSet: boolean; private _resolver: FileSystemResolver | ContentResolver | undefined; constructor(parent: VirtualDirectory, name: string, content?: FileSystemResolver | ContentResolver | string) { - super(name); - this._parent = parent; + super(parent, name); this._content = typeof content === "string" ? content : undefined; this._resolver = typeof content !== "string" ? content : undefined; this._shadowRoot = undefined; this._contentWasSet = this._content !== undefined; } - /** - * Gets the parent directory for this entry. - */ - public get parent(): VirtualDirectory { - return this._parent; - } - /** * Gets the entry that this entry shadows. */ @@ -1470,6 +1660,27 @@ namespace vfs { return shadow; } + /** + * Reads the content and updates the file's access time. + */ + public readContent() { + const content = this.content; + if (content) this.updateAccessTime(); + return content; + } + + /** + * Writes the provided content and updates the file's modification time. + */ + public writeContent(content: string) { + this.content = content; + if (content) this.updateModificationTime(); + } + + public getStats() { + return super.getStatsCore(S_IFREG, this.content ? this.content.length : 0); + } + protected makeReadOnlyCore(): void { /*ignored*/ } } @@ -1548,6 +1759,29 @@ namespace vfs { return shadow; } + public readContent() { + return this.content; + } + + public writeContent(content: string) { + this.content = content; + } + + public readTargetPath() { + const targetPath = this.targetPath; + if (targetPath) this.updateAccessTime(); + return targetPath; + } + + public writeTargetPath(targetPath: string) { + this.targetPath = targetPath; + if (targetPath) this.updateModificationTime(); + } + + public getStats() { + return super.getStatsCore(S_IFLNK, this.targetPath.length); + } + private resolveTarget() { if (!this._target) { const entry = findTarget(this.fileSystem, this.targetPath); @@ -1598,6 +1832,48 @@ namespace vfs { protected onTargetFileSystemChange() { /* views do not propagate file system events */ } } + export class VirtualStats { + public readonly dev: number; + public readonly ino: number; + public readonly mode: number; + public readonly size: number; + public readonly atimeMS: number; + public readonly mtimeMS: number; + public readonly ctimeMS: number; + public readonly birthtimeMS: number; + public readonly atime: Date; + public readonly mtime: Date; + public readonly ctime: Date; + public readonly birthtime: Date; + constructor(dev: number, ino: number, mode: number, size: number, + atimeMS: number, mtimeMS: number, ctimeMS: number, birthtimeMS: number) { + this.dev = dev; + this.ino = ino; + this.mode = mode; + this.size = size; + this.atimeMS = atimeMS; + this.mtimeMS = mtimeMS; + this.ctimeMS = ctimeMS; + this.birthtimeMS = birthtimeMS; + this.atime = new Date(atimeMS + 0.5); + this.mtime = new Date(mtimeMS + 0.5); + this.ctime = new Date(ctimeMS + 0.5); + this.birthtime = new Date(birthtimeMS + 0.5); + } + + public isFile() { + return (this.mode & S_IFMT) === S_IFREG; + } + + public isDirectory() { + return (this.mode & S_IFMT) === S_IFDIR; + } + + public isSymbolicLink() { + return (this.mode & S_IFMT) === S_IFLNK; + } + } + function findTarget(vfs: VirtualFileSystem, target: string, set?: Set): VirtualEntry | undefined { const entry = vfs.getEntry(target); if (entry instanceof VirtualFileSymlink || entry instanceof VirtualDirectorySymlink) { diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 1238e7d437e5e..c1d99edb8ed13 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -1,4 +1,5 @@ /// +/// // TODO(rbuckton): Migrate this to use vfs. @@ -160,7 +161,7 @@ interface Array {}` checkMapKeys(`watchedDirectories${recursive ? " recursive" : ""}`, recursive ? host.watchedDirectoriesRecursive : host.watchedDirectories, expectedDirectories); } - export function checkOutputContains(host: TestServerHost, expected: ReadonlyArray) { + export function checkOutputContains(host: TestServerHost | mocks.MockServerHost, expected: ReadonlyArray) { const mapExpected = arrayToSet(expected); const mapSeen = createMap(); for (const f of host.getOutput()) { @@ -173,7 +174,7 @@ interface Array {}` assert.equal(mapExpected.size, 0, `Output has missing ${JSON.stringify(flatMapIter(mapExpected.keys(), key => key))} in ${JSON.stringify(host.getOutput())}`); } - export function checkOutputDoesNotContain(host: TestServerHost, expectedToBeAbsent: string[] | ReadonlyArray) { + export function checkOutputDoesNotContain(host: TestServerHost | mocks.MockServerHost, expectedToBeAbsent: string[] | ReadonlyArray) { const mapExpectedToBeAbsent = arrayToSet(expectedToBeAbsent); for (const f of host.getOutput()) { assert.isFalse(mapExpectedToBeAbsent.has(f), `Contains ${f} in ${JSON.stringify(host.getOutput())}`); @@ -686,4 +687,5 @@ interface Array {}` } readonly getEnvironmentVariable = notImplemented; } -} + +} \ No newline at end of file diff --git a/tests/cases/conformance/types/never/neverInference.ts b/tests/cases/conformance/types/never/neverInference.ts index 6570101c56e68..11e55c2efcf0e 100644 --- a/tests/cases/conformance/types/never/neverInference.ts +++ b/tests/cases/conformance/types/never/neverInference.ts @@ -1,4 +1,4 @@ -// @lib: es5 +// @lib: es2015 // @strict: true // @target: es2015 From 3d3977f2b78311b36cb7e69290a3ec76afaa54e7 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Sun, 12 Nov 2017 22:55:29 -0800 Subject: [PATCH 13/54] Migrate compileOnSave tests to vfs --- src/harness/mocks.ts | 5 +- src/harness/unittests/compileOnSave.ts | 143 ++++++++++++++++++++----- src/harness/vfs.ts | 68 ++++++------ 3 files changed, 155 insertions(+), 61 deletions(-) diff --git a/src/harness/mocks.ts b/src/harness/mocks.ts index 051fdc094a495..315677b7117fd 100644 --- a/src/harness/mocks.ts +++ b/src/harness/mocks.ts @@ -1,5 +1,7 @@ /// -/// +/// import { debug } from "util"; + + // NOTE: The contents of this file are all exported from the namespace 'mocks'. This is to // support the eventual conversion of harness into a modular system. @@ -298,7 +300,6 @@ namespace mocks { return undefined; } - // TOOD: record and invoke callbacks to simulate timer events public setTimeout(callback: (...args: any[]) => void, timeout: number, ...args: any[]) { return this.timers.setTimeout(callback, timeout, ...args); } diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index 7ef3e2aa1af68..36f9d1c366bce 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -1,6 +1,7 @@ /// /// /// +/// namespace ts.projectSystem { import CommandNames = server.CommandNames; @@ -58,6 +59,24 @@ namespace ts.projectSystem { // A compile on save affected file request using file1 let moduleFile1FileListRequest: server.protocol.Request; + let sharedFs: vfs.VirtualFileSystem; + before(() => { + const fs = new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true); + fs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + fs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + fs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + fs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + fs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + fs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + fs.addFile(libFile.path, libFile.content); + fs.makeReadOnly(); + sharedFs = fs; + }); + + after(() => { + sharedFs = undefined; + }); + beforeEach(() => { moduleFile1 = { path: "/a/b/moduleFile1.ts", @@ -115,7 +134,7 @@ namespace ts.projectSystem { }); it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]); + const host = new mocks.MockServerHost(sharedFs.shadow()); const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -140,7 +159,7 @@ namespace ts.projectSystem { }); it("should be up-to-date with the reference map changes", () => { - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]); + const host = new mocks.MockServerHost(sharedFs.shadow()); const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -187,7 +206,7 @@ namespace ts.projectSystem { }); it("should be up-to-date with changes made in non-open files", () => { - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]); + const host = new mocks.MockServerHost(sharedFs.shadow()); const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -196,15 +215,13 @@ namespace ts.projectSystem { // Send an initial compileOnSave request sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); - file1Consumer1.content = `let y = 10;`; - host.reloadFS([moduleFile1, file1Consumer1, file1Consumer2, configFile, libFile]); - + host.vfs.writeFile(file1Consumer1.path, `let y = 10;`); session.executeCommand(changeModuleFile1ShapeRequest1); sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer2] }]); }); it("should be up-to-date with deleted files", () => { - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]); + const host = new mocks.MockServerHost(sharedFs.shadow()); const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -212,13 +229,14 @@ namespace ts.projectSystem { sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); session.executeCommand(changeModuleFile1ShapeRequest1); - // Delete file1Consumer2 - host.reloadFS([moduleFile1, file1Consumer1, configFile, libFile]); + + host.vfs.removeFile(file1Consumer2.path); + sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1] }]); }); it("should be up-to-date with newly created files", () => { - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]); + const host = new mocks.MockServerHost(sharedFs.shadow()); const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -229,8 +247,7 @@ namespace ts.projectSystem { path: "/a/b/file1Consumer3.ts", content: `import {Foo} from "./moduleFile1"; let y = Foo();` }; - host.reloadFS([moduleFile1, file1Consumer1, file1Consumer2, file1Consumer3, globalFile3, configFile, libFile]); - host.runQueuedTimeoutCallbacks(); + host.vfs.writeFile(file1Consumer3.path, file1Consumer3.content); session.executeCommand(changeModuleFile1ShapeRequest1); sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2, file1Consumer3] }]); }); @@ -254,7 +271,12 @@ namespace ts.projectSystem { }` }; - const host = createServerHost([moduleFile1, file1Consumer1, configFile, libFile]); + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(moduleFile1.path, moduleFile1.content); + host.vfs.addFile(file1Consumer1.path, file1Consumer1.content); + host.vfs.addFile(configFile.path, configFile.content); + host.vfs.addFile(libFile.path, libFile.content); + const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -271,7 +293,7 @@ namespace ts.projectSystem { }); it("should return all files if a global file changed shape", () => { - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]); + const host = new mocks.MockServerHost(sharedFs.shadow()); const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -297,7 +319,8 @@ namespace ts.projectSystem { content: `{}` }; - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, configFile, libFile]); + const host = new mocks.MockServerHost(sharedFs.shadow()); + host.vfs.writeFile(configFile.path, configFile.content); const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); openFilesForSession([moduleFile1], session); @@ -319,7 +342,10 @@ namespace ts.projectSystem { }` }; - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, configFile2, configFile, libFile]); + const host = new mocks.MockServerHost(sharedFs.shadow()); + host.vfs.writeFile(configFile.path, configFile.content); + host.vfs.addFile(configFile2.path, configFile2.content); + const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -338,7 +364,12 @@ namespace ts.projectSystem { }` }; - const host = createServerHost([moduleFile1, file1Consumer1, configFile, libFile]); + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(moduleFile1.path, moduleFile1.content); + host.vfs.addFile(file1Consumer1.path, file1Consumer1.content); + host.vfs.addFile(configFile.path, configFile.content); + host.vfs.addFile(libFile.path, libFile.content); + const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); openFilesForSession([moduleFile1], session); @@ -367,7 +398,12 @@ namespace ts.projectSystem { }` }; - const host = createServerHost([moduleFile1, file1Consumer1, configFile, libFile]); + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(moduleFile1.path, moduleFile1.content); + host.vfs.addFile(file1Consumer1.path, file1Consumer1.content); + host.vfs.addFile(configFile.path, configFile.content); + host.vfs.addFile(libFile.path, libFile.content); + const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); openFilesForSession([moduleFile1], session); @@ -389,7 +425,16 @@ namespace ts.projectSystem { path: "/a/b/file1Consumer1Consumer1.ts", content: `import {y} from "./file1Consumer1";` }; - const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer1Consumer1, globalFile3, configFile, libFile]); + + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(moduleFile1.path, moduleFile1.content); + host.vfs.addFile(file1Consumer1.path, file1Consumer1.content); + host.vfs.addFile(file1Consumer1Consumer1.path, file1Consumer1Consumer1.content); + host.vfs.addFile(globalFile3.path, globalFile3.content); + host.vfs.addFile(configFile.path, configFile.content); + host.vfs.addFile(libFile.path, libFile.content); + host.vfs.addFile(file1Consumer1Consumer1.path, file1Consumer1Consumer1.content); + const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -422,7 +467,12 @@ namespace ts.projectSystem { /// export var t2 = 10;` }; - const host = createServerHost([file1, file2, configFile]); + + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(file1.path, file1.content); + host.vfs.addFile(file2.path, file2.content); + host.vfs.addFile(configFile.path, configFile.content); + const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, typingsInstaller); @@ -438,7 +488,13 @@ namespace ts.projectSystem { const configFile1: FileOrFolder = { path: "/a/b/tsconfig.json", content: `{ "compileOnSave": true }` }; const configFile2: FileOrFolder = { path: "/a/c/tsconfig.json", content: `{ "compileOnSave": true }` }; - const host = createServerHost([file1, file2, file3, configFile1, configFile2]); + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(file1.path, file1.content); + host.vfs.addFile(file2.path, file2.content); + host.vfs.addFile(file3.path, file3.content); + host.vfs.addFile(configFile1.path, configFile1.content); + host.vfs.addFile(configFile2.path, configFile2.content); + const session = createSession(host); openFilesForSession([file1, file2, file3], session); @@ -457,16 +513,23 @@ namespace ts.projectSystem { /// export var x = Foo();` }; - const host = createServerHost([moduleFile1, referenceFile1, configFile]); + + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(moduleFile1.path, moduleFile1.content); + host.vfs.addFile(referenceFile1.path, referenceFile1.content); + host.vfs.addFile(configFile.path, configFile.content); + const session = createSession(host); openFilesForSession([referenceFile1], session); - host.reloadFS([referenceFile1, configFile]); + + host.vfs.removeFile(moduleFile1.path); const request = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: referenceFile1.path }); sendAffectedFileRequestAndCheckResult(session, request, [ { projectFileName: configFile.path, files: [referenceFile1] } ]); + const requestForMissingFile = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: moduleFile1.path }); sendAffectedFileRequestAndCheckResult(session, requestForMissingFile, []); }); @@ -478,10 +541,15 @@ namespace ts.projectSystem { /// export var x = Foo();` }; - const host = createServerHost([referenceFile1, configFile]); + + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(referenceFile1.path, referenceFile1.content); + host.vfs.addFile(configFile.path, configFile.content); + const session = createSession(host); openFilesForSession([referenceFile1], session); + const request = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: referenceFile1.path }); sendAffectedFileRequestAndCheckResult(session, request, [ { projectFileName: configFile.path, files: [referenceFile1] } @@ -502,7 +570,10 @@ namespace ts.projectSystem { path: path + ts.Extension.Ts, content: lines.join(newLine) }; - const host = createServerHost([f], { newLine }); + + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true), /*executingFilePath*/ undefined, newLine); + host.vfs.addFile(f.path, f.content); + const session = createSession(host); const openRequest: server.protocol.OpenRequest = { seq: 1, @@ -536,7 +607,13 @@ namespace ts.projectSystem { path: "/a/b/tsconfig.json", content: `{}` }; - const host = createServerHost([file1, file2, configFile, libFile], { newLine: "\r\n" }); + + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true), /*executingFilePath*/ undefined, "\r\n"); + host.vfs.addFile(file1.path, file1.content); + host.vfs.addFile(file2.path, file2.content); + host.vfs.addFile(configFile.path, configFile.content); + host.vfs.addFile(libFile.path, libFile.content); + const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, { typingsInstaller }); @@ -564,7 +641,13 @@ namespace ts.projectSystem { content: "console.log('file3');" }; const externalProjectName = "/a/b/externalproject"; - const host = createServerHost([file1, file2, file3, libFile]); + + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(file1.path, file1.content); + host.vfs.addFile(file2.path, file2.content); + host.vfs.addFile(file3.path, file3.content); + host.vfs.addFile(libFile.path, libFile.content); + const session = createSession(host); const projectService = session.getProjectService(); @@ -596,7 +679,11 @@ namespace ts.projectSystem { content: "consonle.log('file1');" }; const externalProjectName = "/root/TypeScriptProject3/TypeScriptProject3/TypeScriptProject3.csproj"; - const host = createServerHost([file1, libFile]); + + const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); + host.vfs.addFile(file1.path, file1.content); + host.vfs.addFile(libFile.path, libFile.content); + const session = createSession(host); const projectService = session.getProjectService(); diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index 0fcaef05443ee..92f34f6b832cb 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -869,7 +869,7 @@ namespace vfs { * Gets the root directory for this entry. */ public get root(): VirtualDirectory | undefined { - return this.parent instanceof VirtualRoot ? this : undefined; + return this.parent instanceof VirtualRoot ? this : this.parent.root; } /** @@ -1129,11 +1129,13 @@ namespace vfs { const { files, directories } = resolver.getEntries(this); for (const dir of directories) { const vdir = new VirtualDirectory(this, dir, resolver); + vdir.addListener("fileSystemChange", this._onChildFileSystemChange); if (this.isReadOnly) vdir.makeReadOnly(); entries.set(vdir.name, vdir); } for (const file of files) { const vfile = new VirtualFile(this, file, resolver); + vfile.addListener("fileSystemChange", this._onChildFileSystemChange); if (this.isReadOnly) vfile.makeReadOnly(); entries.set(vfile.name, vfile); } @@ -1141,6 +1143,7 @@ namespace vfs { else if (shadowRoot) { shadowRoot.getOwnEntries().forEach(entry => { const clone = entry.shadow(this); + clone.addListener("fileSystemChange", this._onChildFileSystemChange); if (this.isReadOnly) clone.makeReadOnly(); entries.set(clone.name, clone); }); @@ -1292,7 +1295,7 @@ namespace vfs { this.updateAccessTime(); this.updateModificationTime(); this.emit("childAdded", entry); - entry.emit("fileSystemChange", entry.path, "added"); + this.emit("fileSystemChange", entry.path, "added"); entry.addListener("fileSystemChange", this._onChildFileSystemChange); } @@ -1618,34 +1621,14 @@ namespace vfs { * Gets the text content of this file. */ public get content(): string | undefined { - if (!this._contentWasSet) { - const resolver = this._resolver; - const shadowRoot = this._shadowRoot; - if (resolver) { - this._resolver = undefined; - this._content = typeof resolver === "function" ? resolver(this) : resolver.getContent(this); - this._contentWasSet = true; - } - else if (shadowRoot) { - this._content = shadowRoot.content; - this._contentWasSet = true; - } - } - return this._content; + return this.readContent(/*updateAccessTime*/ false); } /** * Sets the text content of this file. */ public set content(value: string | undefined) { - if (this.content !== value) { - this.writePreamble(); - this._resolver = undefined; - this._content = value; - this._contentWasSet = true; - this.emit("contentChanged", this); - this.emit("fileSystemChange", this.path, "modified"); - } + this.writeContent(value, /*updateModificationType*/ false); } /** @@ -1663,18 +1646,41 @@ namespace vfs { /** * Reads the content and updates the file's access time. */ - public readContent() { - const content = this.content; - if (content) this.updateAccessTime(); - return content; + public readContent(updateAccessTime = true) { + if (!this._contentWasSet) { + const resolver = this._resolver; + const shadowRoot = this._shadowRoot; + if (resolver) { + this._resolver = undefined; + this._content = typeof resolver === "function" ? resolver(this) : resolver.getContent(this); + this._contentWasSet = true; + } + else if (shadowRoot) { + this._content = shadowRoot.content; + this._contentWasSet = true; + } + } + if (this._content && updateAccessTime) { + this.updateAccessTime(); + } + return this._content; } /** * Writes the provided content and updates the file's modification time. */ - public writeContent(content: string) { - this.content = content; - if (content) this.updateModificationTime(); + public writeContent(content: string | undefined, updateModificationTime = true) { + if (this.content !== content) { + this.writePreamble(); + this._resolver = undefined; + this._content = content; + this._contentWasSet = true; + if (content && updateModificationTime) { + this.updateModificationTime(); + } + this.emit("contentChanged", this); + this.emit("fileSystemChange", this.path, "modified"); + } } public getStats() { From 41567b2261f6cd484aadf5510a9ec897dc68fb3e Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 21 Nov 2017 19:47:13 -0800 Subject: [PATCH 14/54] Migrate tscWatchMode to vfs --- .gitignore | 1 + .vscode/tasks.json | 48 +- Gulpfile.ts | 27 +- package.json | 7 +- scripts/typemock/gulpfile.js | 29 + scripts/typemock/package.json | 35 + scripts/typemock/src/arg.ts | 293 ++ scripts/typemock/src/index.ts | 6 + scripts/typemock/src/mock.ts | 394 +++ scripts/typemock/src/spy.ts | 38 + scripts/typemock/src/stub.ts | 103 + scripts/typemock/src/tests/argTests.ts | 646 ++++ scripts/typemock/src/tests/index.ts | 5 + scripts/typemock/src/tests/mockTests.ts | 262 ++ .../typemock/src/tests/sourceMapSupport.ts | 3 + scripts/typemock/src/tests/stubTests.ts | 79 + scripts/typemock/src/tests/timersTests.ts | 305 ++ scripts/typemock/src/tests/timesTests.ts | 236 ++ scripts/typemock/src/tests/utils.ts | 17 + scripts/typemock/src/timers.ts | 475 +++ scripts/typemock/src/times.ts | 120 + scripts/typemock/src/tsconfig.json | 10 + src/harness/core.ts | 125 +- src/harness/mocks.ts | 278 +- src/harness/tsconfig.json | 1 + src/harness/typemock.ts | 98 + src/harness/unittests/compileOnSave.ts | 757 ++--- src/harness/unittests/projectErrors.ts | 241 +- .../unittests/reuseProgramStructure.ts | 4 +- src/harness/unittests/tscWatchMode.ts | 2972 +++++++---------- .../unittests/tsserverProjectSystem.ts | 28 +- src/harness/unittests/typingsInstaller.ts | 584 ++-- src/harness/utils.ts | 22 + src/harness/vfs.ts | 173 +- src/harness/virtualFileSystemWithWatch.ts | 113 +- 35 files changed, 5585 insertions(+), 2950 deletions(-) create mode 100644 scripts/typemock/gulpfile.js create mode 100644 scripts/typemock/package.json create mode 100644 scripts/typemock/src/arg.ts create mode 100644 scripts/typemock/src/index.ts create mode 100644 scripts/typemock/src/mock.ts create mode 100644 scripts/typemock/src/spy.ts create mode 100644 scripts/typemock/src/stub.ts create mode 100644 scripts/typemock/src/tests/argTests.ts create mode 100644 scripts/typemock/src/tests/index.ts create mode 100644 scripts/typemock/src/tests/mockTests.ts create mode 100644 scripts/typemock/src/tests/sourceMapSupport.ts create mode 100644 scripts/typemock/src/tests/stubTests.ts create mode 100644 scripts/typemock/src/tests/timersTests.ts create mode 100644 scripts/typemock/src/tests/timesTests.ts create mode 100644 scripts/typemock/src/tests/utils.ts create mode 100644 scripts/typemock/src/timers.ts create mode 100644 scripts/typemock/src/times.ts create mode 100644 scripts/typemock/src/tsconfig.json create mode 100644 src/harness/typemock.ts diff --git a/.gitignore b/.gitignore index 40c473d13dd83..5087f4983d2a3 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js scripts/generateLocalizedDiagnosticMessages.js scripts/*.js.map scripts/typings/ +scripts/typemock/dist coverage/ internal/ **/.DS_Store diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 31928f73ce217..2f6f528677583 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,30 +1,34 @@ -// Available variables which can be used inside of strings. -// ${workspaceRoot}: the root folder of the team -// ${file}: the current opened file -// ${fileBasename}: the current opened file's basename -// ${fileDirname}: the current opened file's dirname -// ${fileExtname}: the current opened file's extension -// ${cwd}: the current working directory of the spawned process { - "version": "0.1.0", - "command": "gulp", - "isShellCommand": true, - "showOutput": "silent", + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", "tasks": [ { - "taskName": "local", - "isBuildCommand": true, - "showOutput": "silent", - "problemMatcher": [ - "$tsc" - ] + "type": "shell", + "identifier": "local", + "label": "gulp: local", + "command": "gulp", + "args": ["local"], + "group": { "kind": "build", "isDefault": true }, + "problemMatcher": ["$gulp-tsc"] }, { - "taskName": "tests", - "showOutput": "silent", - "problemMatcher": [ - "$tsc" - ] + "type": "shell", + "identifier": "tsc", + "label": "gulp: tsc", + "command": "gulp", + "args": ["tsc"], + "group": "build", + "problemMatcher": ["$gulp-tsc"] + }, + { + "type": "shell", + "identifier": "tests", + "label": "gulp: tests", + "command": "gulp", + "args": ["tests"], + "group": "build", + "problemMatcher": ["$gulp-tsc"] } ] } \ No newline at end of file diff --git a/Gulpfile.ts b/Gulpfile.ts index aedde5c33d955..75043651a37a3 100644 --- a/Gulpfile.ts +++ b/Gulpfile.ts @@ -602,10 +602,19 @@ gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUse return runSequence("LKGInternal", "VerifyLKG"); }); +gulp.task("typemock", () => { + const typemock = tsc.createProject("scripts/typemock/src/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/ true)); + return typemock.src() + .pipe(sourcemaps.init()) + .pipe(newer("scripts/typemock/dist")) + .pipe(typemock()) + .pipe(sourcemaps.write(".", { includeContent: false, destPath: "scripts/typemock/dist" })) + .pipe(gulp.dest("scripts/typemock/dist")); +}); // Task to build the tests infrastructure using the built compiler const run = path.join(builtLocalDirectory, "run.js"); -gulp.task(run, /*help*/ false, [servicesFile, tsserverLibraryFile], () => { +gulp.task(run, /*help*/ false, [servicesFile, tsserverLibraryFile, "typemock"], () => { const testProject = tsc.createProject("src/harness/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/ true)); return testProject.src() .pipe(newer(run)) @@ -644,7 +653,7 @@ function restoreSavedNodeEnv() { process.env.NODE_ENV = savedNodeEnv; } -function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: (e?: any) => void) { +function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: (e?: any) => void, noExit?: boolean) { const lintFlag = cmdLineOptions.lint; cleanTestDirs((err) => { if (err) { console.error(err); failWithStatus(err, 1); } @@ -720,8 +729,10 @@ function runConsoleTests(defaultReporter: string, runInParallel: boolean, done: }); function failWithStatus(err?: any, status?: number) { - if (err || status) { - process.exit(typeof status === "number" ? status : 2); + if (!noExit) { + if (err || status) { + process.exit(typeof status === "number" ? status : 2); + } } done(); } @@ -762,6 +773,10 @@ gulp.task("runtests", runConsoleTests("mocha-fivemat-progress-reporter", /*runInParallel*/ false, done); }); +gulp.task("runtests-in-watch", ["build-rules", "tests"], done => { + runConsoleTests("min", /*runInParallel*/ false, done, /*noExit*/ true); +}); + const nodeServerOutFile = "tests/webTestServer.js"; const nodeServerInFile = "tests/webTestServer.ts"; gulp.task(nodeServerOutFile, /*help*/ false, [servicesFile], () => { @@ -1110,3 +1125,7 @@ gulp.task("default", "Runs 'local'", ["local"]); gulp.task("watch", "Watches the src/ directory for changes and executes runtests-parallel.", [], () => { gulp.watch("src/**/*.*", ["runtests-parallel"]); }); + +gulp.task("watch-no-parallel", "Watches the src/ directory for changes and executes runtests.", [], () => { + gulp.watch(["src/**/*.*", "scripts/typemock/src/**/*.*"], ["runtests-in-watch"]); +}); \ No newline at end of file diff --git a/package.json b/package.json index e329db05d85a2..583e59a774122 100644 --- a/package.json +++ b/package.json @@ -48,12 +48,13 @@ "@types/node": "latest", "@types/q": "latest", "@types/run-sequence": "latest", + "@types/source-map-support": "^0.4.0", "@types/through2": "latest", "@types/xml2js": "^0.4.0", - "xml2js": "^0.4.19", "browser-resolve": "^1.11.2", "browserify": "latest", "chai": "latest", + "colors": "latest", "convert-source-map": "latest", "del": "latest", "gulp": "3.X", @@ -79,9 +80,9 @@ "travis-fold": "latest", "ts-node": "latest", "tslint": "latest", + "typescript": "next", "vinyl": "latest", - "colors": "latest", - "typescript": "next" + "xml2js": "^0.4.19" }, "scripts": { "pretest": "jake tests", diff --git a/scripts/typemock/gulpfile.js b/scripts/typemock/gulpfile.js new file mode 100644 index 0000000000000..127ef3dc51e69 --- /dev/null +++ b/scripts/typemock/gulpfile.js @@ -0,0 +1,29 @@ +const gulp = require("gulp"); +const gutil = require("gulp-util"); +const sourcemaps = require("gulp-sourcemaps"); +const tsb = require("gulp-tsb"); +const mocha = require("gulp-mocha"); +const del = require("del"); + +const src = { + compile: tsb.create("src/tsconfig.json"), + src: () => gulp.src(["src/**/*.ts"]), + dest: () => gulp.dest("dist") +}; + +gulp.task("clean", () => del(["dist/**/*"])); + +gulp.task("build", () => src.src() + .pipe(sourcemaps.init()) + .pipe(src.compile()) + .pipe(sourcemaps.write(".", { includeContent: false, destPath: "dist" })) + .pipe(gulp.dest("dist"))); + +gulp.task("test", ["build"], () => gulp + .src(["dist/tests/index.js"], { read: false }) + .pipe(mocha({ reporter: "dot" }))); + + +gulp.task("watch", ["test"], () => gulp.watch(["src/**/*"], ["test"])); + +gulp.task("default", ["test"]); \ No newline at end of file diff --git a/scripts/typemock/package.json b/scripts/typemock/package.json new file mode 100644 index 0000000000000..e18761f0ba777 --- /dev/null +++ b/scripts/typemock/package.json @@ -0,0 +1,35 @@ +{ + "private": true, + "name": "typemock", + "version": "0.0.0", + "description": "JavaScript Mock object framework", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "test": "gulp test" + }, + "keywords": [ + "javascript", + "mock", + "type", + "typescript" + ], + "author": "Ron Buckton (ron.buckton@microsoft.com)", + "license": "Apache-2.0", + "devDependencies": { + "@types/chai": "^4.0.4", + "@types/mocha": "^2.2.27", + "@types/node": "^8.0.20", + "@types/source-map-support": "^0.4.0", + "chai": "^4.1.2", + "del": "^2.0.2", + "gulp": "^3.9.1", + "gulp-mocha": "^4.3.1", + "gulp-sourcemaps": "^2.6.1", + "gulp-tsb": "^2.0.5", + "merge2": "^0.3.6", + "mocha": "^2.2.5", + "source-map-support": "^0.5.0", + "typescript": "^2.6.1" + } +} diff --git a/scripts/typemock/src/arg.ts b/scripts/typemock/src/arg.ts new file mode 100644 index 0000000000000..7d6feb5383d48 --- /dev/null +++ b/scripts/typemock/src/arg.ts @@ -0,0 +1,293 @@ +/** + * Represents an argument condition used during verification. + */ +export class Arg { + private _condition: (value: any, args: ReadonlyArray, index: number) => { valid: boolean, next?: number }; + private _message: string; + + private constructor(condition: (value: any, args: ReadonlyArray, index: number) => { valid: boolean, next?: number }, message: string) { + this._condition = condition; + this._message = message; + } + + /** + * Allows any value. + */ + public static any(): T & Arg { + return new Arg(() => ({ valid: true }), `any`); + } + + /** + * Allows a value that matches the specified condition. + * @param match The condition used to match the value. + */ + public static is(match: (value: T) => boolean): T & Arg { + return new Arg(value => ({ valid: match(value) }), `is`); + } + + /** + * Allows only a null value. + */ + public static null(): T & Arg { + return new Arg(value => ({ valid: value === null }), `null`); + } + + /** + * Allows only a non-null value. + */ + public static notNull(): T & Arg { + return Arg.not(Arg.null()); + } + + /** + * Allows only an undefined value. + */ + public static undefined(): T & Arg { + return new Arg(value => ({ valid: value === undefined }), `undefined`); + } + + /** + * Allows only a non-undefined value. + */ + public static notUndefined(): T & Arg { + return Arg.not(Arg.undefined()); + } + + /** + * Allows only an undefined or null value. + */ + public static nullOrUndefined(): T & Arg { + return Arg.or(Arg.null(), Arg.undefined()); + } + + /** + * Allows only a non-undefined, non-null value. + */ + public static notNullOrUndefined(): T & Arg { + return Arg.not(Arg.nullOrUndefined()); + } + + /** + * Allows any value within the provided range. + * @param min The minimum value. + * @param max The maximum value. + */ + public static between(min: T, max: T): T & Arg { + return new Arg(value => ({ valid: min <= value && value <= max }), `between ${min} and ${max}`); + } + + /** + * Allows any value in the provided array. + */ + public static in(values: T[]): T & Arg { + return new Arg(value => ({ valid: values.indexOf(value) > -1 }), `in ${values.join(", ")}`); + } + + /** + * Allows any value not in the provided array. + */ + public static notIn(values: T[]): T & Arg { + return Arg.not(Arg.in(values)); + } + + /** + * Allows any value that matches the provided pattern. + */ + public static match(pattern: RegExp): T & Arg { + return new Arg(value => ({ valid: pattern.test(value) }), `matches ${pattern}`); + } + + public static startsWith(text: string): string & Arg { + return new Arg(value => ({ valid: String(value).startsWith(text) }), `starts with ${text}`); + } + + public static endsWith(text: string): string & Arg { + return new Arg(value => ({ valid: String(value).endsWith(text) }), `ends with ${text}`); + } + + public static includes(text: string): string & Arg { + return new Arg(value => ({ valid: String(value).includes(text) }), `contains ${text}`); + } + + /** + * Allows any value with the provided `typeof` tag. + */ + public static typeof(tag: "string"): string & Arg; + /** + * Allows any value with the provided `typeof` tag. + */ + public static typeof(tag: "number"): number & Arg; + /** + * Allows any value with the provided `typeof` tag. + */ + public static typeof(tag: "boolean"): boolean & Arg; + /** + * Allows any value with the provided `typeof` tag. + */ + public static typeof(tag: "symbol"): symbol & Arg; + /** + * Allows any value with the provided `typeof` tag. + */ + public static typeof(tag: "object"): object & Arg; + /** + * Allows any value with the provided `typeof` tag. + */ + public static typeof(tag: "function"): ((...args: any[]) => any) & Arg; + /** + * Allows any value with the provided `typeof` tag. + */ + public static typeof(tag: "undefined"): undefined & Arg; + /** + * Allows any value with the provided `typeof` tag. + */ + public static typeof(tag: string): T & Arg; + public static typeof(tag: string): any { + return new Arg(value => ({ valid: typeof value === tag }), `typeof ${tag}`); + } + + public static string() { return this.typeof("string"); } + public static number() { return this.typeof("number"); } + public static boolean() { return this.typeof("boolean"); } + public static symbol() { return this.typeof("symbol"); } + public static object() { return this.typeof("object"); } + public static function() { return this.typeof("function"); } + + /** + * Allows any value that is an instance of the provided function. + * @param type The expected constructor. + */ + public static instanceof(type: TClass): TClass["prototype"] & Arg { + return new Arg(value => ({ valid: value instanceof type }), `instanceof ${type.name}`); + } + + /** + * Allows any value that has the provided property names in its prototype chain. + */ + public static has(...names: string[]): T & Arg { + return new Arg(value => ({ valid: names.filter(name => name in value).length === names.length }), `has ${names.join(", ")}`); + } + + /** + * Allows any value that has the provided property names on itself but not its prototype chain. + */ + public static hasOwn(...names: string[]): T & Arg { + return new Arg(value => ({ valid: names.filter(name => Object.prototype.hasOwnProperty.call(value, name)).length === names.length }), `hasOwn ${names.join(", ")}`); + } + + /** + * Allows any value that matches the provided condition for the rest of the arguments in the call. + * @param condition The optional condition for each other element. + */ + public static rest(condition?: T | (T & Arg)): T & Arg { + if (condition === undefined) { + return new Arg((_, args) => ({ valid: true, next: args.length }), `rest`); + } + + const arg = Arg.from(condition); + return new Arg( + (_, args, index) => { + while (index < args.length) { + const { valid, next } = Arg.validate(arg, args, index); + if (!valid) return { valid: false }; + index = typeof next === "undefined" ? index + 1 : next; + } + return { valid: true, next: index }; + }, + `rest ${arg._message}` + ); + } + + /** + * Negates a condition. + */ + public static not(value: T | (T & Arg)): T & Arg { + const arg = Arg.from(value); + return new Arg((value, args, index) => { + const result = arg._condition(value, args, index); + return { valid: !result.valid, next: result.next }; + }, `not ${arg._message}`); + } + + /** + * Combines conditions, where all conditions must be `true`. + */ + public static and(...args: ((T & Arg) | T)[]): T & Arg { + const conditions = args.map(Arg.from); + return new Arg((value, args, index) => { + for (const condition of conditions) { + const result = condition._condition(value, args, index); + if (!result.valid) return { valid: false }; + } + return { valid: true }; + }, conditions.map(condition => condition._message).join(" and ")); + } + + /** + * Combines conditions, where no condition may be `true`. + */ + public static nand(...args: ((T & Arg) | T)[]): T & Arg { + return this.not(this.and(...args)); + } + + /** + * Combines conditions, where any conditions may be `true`. + */ + public static or(...args: ((T & Arg) | T)[]): T & Arg { + const conditions = args.map(Arg.from); + return new Arg((value, args, index) => { + for (const condition of conditions) { + const result = condition._condition(value, args, index); + if (result.valid) return { valid: true }; + } + return { valid: false }; + }, conditions.map(condition => condition._message).join(" or ")); + } + + /** + * Combines conditions, where all conditions must be `true`. + */ + public static nor(...args: ((T & Arg) | T)[]): T & Arg { + return this.not(this.or(...args)); + } + + /** + * Ensures the value is a `Condition` + * @param value The value to coerce + * @returns The condition + */ + public static from(value: T): T & Arg { + if (value instanceof Arg) { + return value; + } + + return new Arg(v => ({ valid: is(v, value) }), JSON.stringify(value)); + } + + /** + * Validates the arguments against the condition. + * @param args The arguments for the execution + * @param index The current index into the `args` array + * @returns An object that specifies whether the condition is `valid` and what the `next` index should be. + */ + public static validate(arg: Arg, args: ReadonlyArray, index: number): { valid: boolean, next?: number } { + const value = index >= 0 && index < args.length ? args[index] : undefined; + const { valid, next } = arg._condition(value, args, index); + return valid + ? { valid: true, next: next === undefined ? index + 1 : next } + : { valid: false }; + } + + /** + * Gets a string that represents this condition. + */ + public toString(): string { + return `<${this._message}>`; + } +} + +/** + * SameValueZero (from ECMAScript spec), which has stricter equality sematics than "==" or "===". + */ +function is(x: any, y: any) { + return (x === y) ? (x !== 0 || 1 / x === 1 / y) : (x !== x && y !== y); +} \ No newline at end of file diff --git a/scripts/typemock/src/index.ts b/scripts/typemock/src/index.ts new file mode 100644 index 0000000000000..aa94febd01b79 --- /dev/null +++ b/scripts/typemock/src/index.ts @@ -0,0 +1,6 @@ +export { Arg } from "./arg"; +export { Times } from "./times"; +export { Mock, Returns, Throws } from "./mock"; +export { Spy, Callable, Constructable } from "./spy"; +export { Stub } from "./stub"; +export { Timers, Timer, Timeout, Interval, Immediate, AnimationFrame } from "./timers"; \ No newline at end of file diff --git a/scripts/typemock/src/mock.ts b/scripts/typemock/src/mock.ts new file mode 100644 index 0000000000000..85d441c838235 --- /dev/null +++ b/scripts/typemock/src/mock.ts @@ -0,0 +1,394 @@ +import { Times } from "./times"; +import { Arg } from "./arg"; + +const weakHandler = new WeakMap>(); + +function noop() {} + +function getHandler(value: object) { + return weakHandler.get(value); +} + +export interface Returns { + returns: U; +} + +export interface Throws { + throws: any; +} + +/** + * A mock version of another oject + */ +export class Mock { + private _target: T; + private _handler = new MockHandler(); + private _proxy: T; + private _revoke: () => void; + + /** + * A mock version of another object + * @param target The object to mock. + * @param setups Optional setups to use + */ + constructor(target: T = {}, setups?: Partial) { + this._target = target; + + const { proxy, revoke } = Proxy.revocable(this._target, this._handler); + this._proxy = proxy; + this._revoke = revoke; + + weakHandler.set(proxy, this._handler); + + if (setups) { + this.setup(setups); + } + } + + /** + * Gets the mock version of the target + */ + public get value(): T { + return this._proxy; + } + + /** + * Performs setup of the mock object, overriding the target object's functionality with that provided by the setup + * @param callback A function used to set up a method result. + * @param result An object used to describe the result of the method. + * @returns This mock instance. + */ + public setup(callback: (value: T) => U, result?: Returns | Throws): Mock; + /** + * Performs setup of the mock object, overriding the target object's functionality with that provided by the setup + * @param setups An object whose members are used instead of the target object. + * @returns This mock instance. + */ + public setup(setups: Partial): Mock; + public setup(setup: Partial | ((value: T) => U), result?: Returns | Throws): Mock { + if (typeof setup === "function") { + this._handler.setupCall(setup, result); + } + else { + this._handler.setupMembers(setup); + } + return this; + } + + /** + * Performs verification that a specific action occurred. + * @param callback A callback that simulates the expected action. + * @param times The number of times the action should have occurred. + * @returns This mock instance. + */ + public verify(callback: (value: T) => any, times: Times): Mock { + this._handler.verify(callback, times); + return this; + } + + public revoke() { + this._handler.revoke(); + this._revoke(); + } +} + +class Setup { + public recording: Recording; + public result: Partial & Throws> | undefined; + + constructor (recording: Recording, result?: Returns | Throws) { + this.recording = recording; + this.result = result; + } + + public static evaluate(setups: ReadonlyArray | undefined, trap: string, args: any[], newTarget?: any) { + if (setups) { + for (let i = setups.length - 1; i >= 0; i--) { + const setup = setups[i]; + if (setup.recording.trap === trap && + setup.recording.newTarget === newTarget && + setup.matchArguments(args)) { + return setup.getResult(); + } + } + } + throw new Error("No matching setups."); + } + + public matchArguments(args: any[]) { + return this.recording.matchArguments(args); + } + + public getResult() { + if (this.result) { + if (this.result.throws) { + throw this.result.throws; + } + return this.result.returns; + } + return undefined; + } +} + +class Recording { + public readonly trap: string; + public readonly name: PropertyKey | undefined; + public readonly args: ReadonlyArray; + public readonly newTarget: any; + + private _conditions: ReadonlyArray | undefined; + + constructor(trap: string, name: PropertyKey | undefined, args: ReadonlyArray, newTarget?: any) { + this.trap = trap; + this.name = name; + this.args = args || []; + this.newTarget = newTarget; + } + + public get conditions() { + return this._conditions || (this._conditions = this.args.map(Arg.from)); + } + + public toString(): string { + return `${this.trap} ${this.name || ""}(${this.conditions.join(", ")})${this.newTarget ? ` [${this.newTarget.name}]` : ``}`; + } + + public matchRecording(recording: Recording) { + if (recording.trap !== this.trap || + recording.name !== this.name || + recording.newTarget !== this.newTarget) { + return false; + } + + return this.matchArguments(recording.args); + } + + public matchArguments(args: ReadonlyArray) { + let argi = 0; + while (argi < this.conditions.length) { + const condition = this.conditions[argi]; + const { valid, next } = Arg.validate(condition, args, argi); + if (!valid) { + return false; + } + argi = typeof next === "number" ? next : argi + 1; + } + if (argi < args.length) { + return false; + } + return true; + } +} + +class MockHandler implements ProxyHandler { + private readonly overrides = Object.create(null); + private readonly recordings: Recording[] = []; + private readonly selfSetups: Setup[] = []; + private readonly memberSetups = new Map(); + private readonly methodTargets = new WeakMap(); + private readonly methodProxies = new Map(); + private readonly methodRevocations = new Set<() => void>(); + + constructor() { + } + + public apply(target: T | Function, thisArg: any, argArray: any[]): any { + if (typeof target === "function") { + this.recordings.push(new Recording("apply", undefined, argArray)); + return this.selfSetups.length > 0 + ? Setup.evaluate(this.selfSetups, "apply", argArray) + : Reflect.apply(target, thisArg, argArray); + } + return undefined; + } + + public construct(target: T | Function, argArray: any[], newTarget?: any): any { + if (typeof target === "function") { + this.recordings.push(new Recording("construct", undefined, argArray, newTarget)); + return this.selfSetups.length > 0 + ? Setup.evaluate(this.selfSetups, "construct", argArray, newTarget) + : Reflect.construct(target, argArray, newTarget); + } + return undefined; + } + + public get(target: T, name: PropertyKey, receiver: any): any { + this.recordings.push(new Recording("get", name, [])); + const value = Reflect.get(this.getTarget(target, name), name, receiver); + return typeof value === "function" ? this.getMethod(name, value) : value; + } + + public set(target: T, name: PropertyKey, value: any, receiver: any): boolean { + this.recordings.push(new Recording("set", name, [value])); + if (typeof value === "function" && this.methodTargets.has(value)) { + value = this.methodTargets.get(value); + } + + return Reflect.set(this.getTarget(target, name), name, value, receiver); + } + + public invoke(proxy: T, name: PropertyKey, method: Function, argArray: any[]): any { + this.recordings.push(new Recording("invoke", name, argArray)); + return Reflect.apply(method, proxy, argArray); + } + + public setupCall(callback: (value: any) => any, result: Returns | Throws | undefined) { + const recording = capture(callback); + if (recording.name === undefined) { + this.selfSetups.push(new Setup(recording, result)); + } + else { + let setups = this.memberSetups.get(recording.name); + if (!setups) { + this.memberSetups.set(recording.name, setups = []); + if (recording.trap === "invoke") { + this.defineMethod(recording.name); + } + else { + this.defineAccessor(recording.name); + } + } + else { + if ((setups[0].recording.trap === "invoke") !== (recording.trap === "invoke")) { + throw new Error(`Cannot mix method and acessor setups for the same property.`); + } + } + + setups.push(new Setup(recording, result)); + } + } + + public setupMembers(setup: object) { + for (const propertyKey of Reflect.ownKeys(setup)) { + const descriptor = Reflect.getOwnPropertyDescriptor(setup, propertyKey); + if (descriptor) { + if (propertyKey in this.overrides) { + throw new Error(`Property '${propertyKey.toString()}' already exists.`); + } + Reflect.defineProperty(this.overrides, propertyKey, descriptor); + } + } + } + + public verify(callback: (value: T) => any, times: Times): void { + const expectation = capture(callback); + + let count: number = 0; + for (const recording of this.recordings) { + if (expectation.matchRecording(recording)) { + count++; + } + } + + times.check(count, `An error occured when verifying expectation: ${expectation}`); + } + + public getTarget(target: T, name: PropertyKey) { + return name in this.overrides ? this.overrides : target; + } + + public getMethod(name: PropertyKey, value: Function): Function { + const proxy = this.methodProxies.get(name); + if (proxy && this.methodTargets.get(proxy) === value) { + return proxy; + } + else { + const { proxy, revoke } = Proxy.revocable(value, new MethodHandler(name)); + this.methodProxies.set(name, proxy); + this.methodRevocations.add(revoke); + this.methodTargets.set(proxy, value); + return proxy; + } + } + + public revoke() { + for (const revoke of this.methodRevocations) { + revoke(); + } + } + + private defineMethod(name: PropertyKey) { + const setups = this.memberSetups; + this.setupMembers({ + [name](...args: any[]) { + return Setup.evaluate(setups.get(name), "invoke", args); + } + }); + } + + private defineAccessor(name: PropertyKey) { + const setups = this.memberSetups; + this.setupMembers({ + get [name]() { + return Setup.evaluate(setups.get(name), "get", []); + }, + set [name](value: any) { + Setup.evaluate(setups.get(name), "set", [value]); + } + }); + } +} + +class MethodHandler { + public name: PropertyKey; + + constructor(name: PropertyKey) { + this.name = name; + } + + public apply(target: Function, thisArgument: any, argumentsList: any[]): any { + const handler = getHandler(thisArgument); + return handler + ? handler.invoke(thisArgument, this.name, target, argumentsList) + : Reflect.apply(target, thisArgument, argumentsList); + } +} + +class CapturingHandler { + public recording: Recording | undefined; + + private _name: PropertyKey; + private _method: Function; + + constructor() { + this._method = (...args: any[]) => { + this.recording = new Recording("invoke", this._name, args); + }; + } + + public apply(_target: object, _thisArg: any, argArray: any[]): any { + this.recording = new Recording("apply", /*name*/ undefined, argArray); + return undefined; + } + + public construct(_target: object, argArray: any[], newTarget?: any): any { + this.recording = new Recording("construct", /*name*/ undefined, argArray, newTarget); + return undefined; + } + + public get(_target: object, name: PropertyKey, _receiver: any): any { + this.recording = new Recording("get", name, []); + this._name = name; + return this._method; + } + + public set(_target: object, name: PropertyKey, value: any, _receiver: any): boolean { + this.recording = new Recording("set", name, [value]); + return true; + } +} + +function capture(callback: (value: T) => U): Recording { + const handler = new CapturingHandler(); + const { proxy, revoke } = Proxy.revocable(noop, handler); + try { + callback(proxy); + if (!handler.recording) { + throw new Error("Nothing was captured."); + } + return handler.recording; + } + finally { + revoke(); + } +} \ No newline at end of file diff --git a/scripts/typemock/src/spy.ts b/scripts/typemock/src/spy.ts new file mode 100644 index 0000000000000..2bb21e6e21d8b --- /dev/null +++ b/scripts/typemock/src/spy.ts @@ -0,0 +1,38 @@ +import { Mock } from "./mock"; +import { Times } from "./times"; +import { Arg } from "./arg"; + +function noop() {} + +export type Callable = ((...args: any[]) => any); + +export type Constructable = (new (...args: any[]) => any); + +export class Spy { + private _mock: Mock; + + constructor(target = noop) { + this._mock = new Mock(target); + } + + public get value(): T { + return this._mock.value; + } + + public verify(callback: (value: T) => any, times: Times): this { + this._mock.verify(callback, times); + return this; + } + + public called(times: Times): this { + return this.verify(_ => (_)(Arg.rest()), times); + } + + public constructed(times: Times): this { + return this.verify(_ => new (_)(Arg.rest()), times); + } + + public revoke(): void { + this._mock.revoke(); + } +} diff --git a/scripts/typemock/src/stub.ts b/scripts/typemock/src/stub.ts new file mode 100644 index 0000000000000..e643aae44d616 --- /dev/null +++ b/scripts/typemock/src/stub.ts @@ -0,0 +1,103 @@ +/** + * Temporarily injects a value into an object property + */ +export class Stub { + private _target: T; + private _key: K; + private _value: any; + private _originalValue: any; + private _installed: boolean = false; + + /** + * Temporarily injects a value into an object property + * @param target The target object into which to inject a property + * @param propertyKey The name of the property to inject + * @param value The value to inject + */ + constructor(target: T, propertyKey: K, value?: T[K]) { + this._target = target; + this._key = propertyKey; + this._value = arguments.length === 2 ? target[propertyKey] : value; + } + + public get target() { + return this._target; + } + + public get key() { + return this._key; + } + + public get stubValue(): T[K] { + return this._installed ? this.currentValue : this._value; + } + + public set stubValue(value: T[K]) { + if (this._installed) { + this._target[this._key] = value; + } + this._value = value; + } + + public get originalValue(): T[K] { + if (this._installed) { + return this._originalValue; + } + else { + return this.currentValue; + } + } + + public get currentValue(): T[K] { + return this._target[this._key]; + } + + /** + * Gets a value indicating whether the Stub is currently installed. + */ + public get installed(): boolean { + return this._installed; + } + + /** + * Installs the stub + */ + public install(): void { + if (this._installed) return; + this._originalValue = this._target[this._key]; + this._target[this._key] = this._value; + this._installed = true; + } + + /** + * Uninstalls the stub + */ + public uninstall(): void { + if (!this._installed) return; + this._target[this._key] = this._originalValue; + this._installed = false; + this._originalValue = null; + } + + public static exec(target: T, propertyKey: K, value: T[K], action: () => V) { + const stub = new Stub(target, propertyKey, value); + return stub.exec(action); + } + + /** + * Executes `action` with the stub installed. + */ + public exec(action: () => V): V { + if (this._installed) { + return action(); + } + try { + this.install(); + return action(); + } + finally { + this.uninstall(); + } + } +} + diff --git a/scripts/typemock/src/tests/argTests.ts b/scripts/typemock/src/tests/argTests.ts new file mode 100644 index 0000000000000..1203097ec5c52 --- /dev/null +++ b/scripts/typemock/src/tests/argTests.ts @@ -0,0 +1,646 @@ +import "./sourceMapSupport"; +import { Arg } from "../arg"; +import { assert } from "chai"; + +describe("arg", () => { + describe("any", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.any()); + + // act + const result = Arg.validate(target, ["a"], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.any()); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("is", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.is(value => value === "a")); + + // act + const result = Arg.validate(target, ["a"], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.is(value => value === "a")); + + // act + const result = Arg.validate(target, ["b"], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.is(value => value === "a")); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("notNull", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.notNull()); + + // act + const result = Arg.validate(target, [{}], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.notNull()); + + // act + const result = Arg.validate(target, [null], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.notNull()); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("null", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.null()); + + // act + const result = Arg.validate(target, [null], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.null()); + + // act + const result = Arg.validate(target, [{}], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.null()); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("notUndefined", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.notUndefined()); + + // act + const result = Arg.validate(target, [{}], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.notUndefined()); + + // act + const result = Arg.validate(target, [undefined], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.notUndefined()); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("undefined", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.undefined()); + + // act + const result = Arg.validate(target, [undefined], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.undefined()); + + // act + const result = Arg.validate(target, [{}], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.undefined()); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("notNullOrUndefined", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.notNullOrUndefined()); + + // act + const result = Arg.validate(target, [{}], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("invalid (null)", () => { + // arrange + const target = Arg.from(Arg.notNullOrUndefined()); + + // act + const result = Arg.validate(target, [null], 0); + + // assert + assert.isFalse(result.valid); + }); + it("invalid (undefined)", () => { + // arrange + const target = Arg.from(Arg.notNullOrUndefined()); + + // act + const result = Arg.validate(target, [undefined], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.notNullOrUndefined()); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("nullOrUndefined", () => { + it("valid (null)", () => { + // arrange + const target = Arg.from(Arg.nullOrUndefined()); + + // act + const result = Arg.validate(target, [null], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("valid (undefined)", () => { + // arrange + const target = Arg.from(Arg.nullOrUndefined()); + + // act + const result = Arg.validate(target, [undefined], 0); + + // assert + assert.isTrue(result.valid); + assert.strictEqual(result.next, 1); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.nullOrUndefined()); + + // act + const result = Arg.validate(target, [{}], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.nullOrUndefined()); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("between", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.between(1, 3)); + + // act + const min = Arg.validate(target, [1], 0); + const mid = Arg.validate(target, [2], 0); + const max = Arg.validate(target, [3], 0); + + // assert + assert.isTrue(min.valid); + assert.isTrue(mid.valid); + assert.isTrue(max.valid); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.between(1, 3)); + + // act + const before = Arg.validate(target, [0], 0); + const after = Arg.validate(target, [4], 0); + + // assert + assert.isFalse(before.valid); + assert.isFalse(after.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.between(1, 3)); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("in", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.in(["a", "b"])); + + // act + const result = Arg.validate(target, ["a"], 0); + + // assert + assert.isTrue(result.valid); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.in(["a", "b"])); + + // act + const result = Arg.validate(target, ["c"], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.in(["a", "b"])); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("notIn", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.notIn(["a", "b"])); + + // act + const result = Arg.validate(target, ["c"], 0); + + // assert + assert.isTrue(result.valid); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.notIn(["a", "b"])); + + // act + const result = Arg.validate(target, ["a"], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.notIn(["a", "b"])); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("match", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.match(/^a$/)); + + // act + const result = Arg.validate(target, ["a"], 0); + + // assert + assert.isTrue(result.valid); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.match(/^a$/)); + + // act + const result = Arg.validate(target, ["b"], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.match(/^a$/)); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("typeof", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.typeof("number")); + + // act + const result = Arg.validate(target, [1], 0); + + // assert + assert.isTrue(result.valid); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.typeof("number")); + + // act + const result = Arg.validate(target, ["a"], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.typeof("number")); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("instanceof", () => { + it("valid", () => { + // arrange + class C {} + const target = Arg.from(Arg.instanceof(C)); + + // act + const result = Arg.validate(target, [new C()], 0); + + // assert + assert.isTrue(result.valid); + }); + it("invalid", () => { + // arrange + class C {} + const target = Arg.from(Arg.instanceof(C)); + + // act + const result = Arg.validate(target, [{}], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + class C {} + const target = Arg.from(Arg.instanceof(C)); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("has", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.has("a")); + + // act + const own = Arg.validate(target, [{ a: 1 }], 0); + const proto = Arg.validate(target, [{ __proto__: { a: 1 } }], 0); + + // assert + assert.isTrue(own.valid); + assert.isTrue(proto.valid); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.has("a")); + + // act + const result = Arg.validate(target, [{ b: 1 }], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.has("a")); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("hasOwn", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.hasOwn("a")); + + // act + const own = Arg.validate(target, [{ a: 1 }], 0); + + // assert + assert.isTrue(own.valid); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.hasOwn("a")); + + // act + const result = Arg.validate(target, [{ b: 1 }], 0); + const proto = Arg.validate(target, [{ __proto__: { a: 1 } }], 0); + + // assert + assert.isFalse(result.valid); + assert.isFalse(proto.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.hasOwn("a")); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("rest", () => { + describe("no condition", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.rest()); + + // act + const empty = Arg.validate(target, [], 0); + const multiple = Arg.validate(target, ["a", "b"], 0); + + // assert + assert.isTrue(empty.valid); + assert.strictEqual(empty.next, 0); + assert.isTrue(multiple.valid); + assert.strictEqual(multiple.next, 2); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.rest()); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + describe("condition", () => { + it("valid", () => { + // arrange + const target = Arg.from(Arg.rest(Arg.typeof("string"))); + + // act + const empty = Arg.validate(target, [], 0); + const multiple = Arg.validate(target, ["a", "b"], 0); + + // assert + assert.isTrue(empty.valid); + assert.strictEqual(empty.next, 0); + assert.isTrue(multiple.valid); + assert.strictEqual(multiple.next, 2); + }); + it("invalid", () => { + // arrange + const target = Arg.from(Arg.rest(Arg.typeof("string"))); + + // act + const result = Arg.validate(target, ["a", 1], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from(Arg.rest(Arg.typeof("string"))); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, ``); + }); + }); + }); + describe("from", () => { + it("valid", () => { + // arrange + const target = Arg.from("a"); + + // act + const result = Arg.validate(target, ["a"], 0); + + // assert + assert.isTrue(result.valid); + }); + it("invalid", () => { + // arrange + const target = Arg.from("a"); + + // act + const result = Arg.validate(target, ["b"], 0); + + // assert + assert.isFalse(result.valid); + }); + it("toString", () => { + // arrange + const target = Arg.from("a"); + + // act + const result = target.toString(); + + // assert + assert.strictEqual(result, `<"a">`); + }); + }); +}); \ No newline at end of file diff --git a/scripts/typemock/src/tests/index.ts b/scripts/typemock/src/tests/index.ts new file mode 100644 index 0000000000000..45a2246e28619 --- /dev/null +++ b/scripts/typemock/src/tests/index.ts @@ -0,0 +1,5 @@ +import "./argTests"; +import "./timesTests"; +import "./mockTests"; +import "./stubTests"; +import "./timersTests"; \ No newline at end of file diff --git a/scripts/typemock/src/tests/mockTests.ts b/scripts/typemock/src/tests/mockTests.ts new file mode 100644 index 0000000000000..38efbdb04c782 --- /dev/null +++ b/scripts/typemock/src/tests/mockTests.ts @@ -0,0 +1,262 @@ +import "./sourceMapSupport"; +import { Mock } from "../mock"; +import { Stub } from "../stub"; +import { Arg } from "../arg"; +import { Times } from "../times"; +import { recordError } from "./utils"; +import { assert } from "chai"; + +describe("mock", () => { + it("mock get with no setups", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); + + // act + const result = mock.value.a; + + // assert + assert.equal(1, result); + }); + it("mock setup property get with return", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target, { get a() { return 2; } }); + + // act + const result = mock.value.a; + + // assert + assert.equal(2, result); + }); + it("mock setup property get with throw", () => { + // arrange + const target = { a: 1 }; + const error = new Error("error"); + const mock = new Mock(target, { get a(): number { throw error; } }); + + // act + const e = recordError(() => mock.value.a); + + // assert + assert.strictEqual(error, e); + }); + it("mock setup property set", () => { + // arrange + let _a: number | undefined; + const target = { a: 1 }; + const mock = new Mock(target, { set a(value: number) { _a = value; } }); + + // act + mock.value.a = 2; + + // assert + assert.equal(2, _a); + assert.equal(1, target.a); + }); + it("mock setup property set with throw", () => { + // arrange + const target = { a: 1 }; + const error = new Error("error"); + const mock = new Mock(target, { set a(value: number) { throw error; } }); + + // act + const e = recordError(() => mock.value.a = 2); + + // assert + assert.strictEqual(error, e); + }); + it("mock setup method call no setups", () => { + // arrange + const target = { a() { return 1; } }; + const mock = new Mock(target); + + // act + const result = mock.value.a(); + + // assert + assert.equal(1, result); + }); + it("mock setup method callback", () => { + // arrange + const target = { a() { return 1; } }; + const mock = new Mock(target, { a() { return 2; } }); + + // act + const result = mock.value.a(); + + // assert + assert.equal(2, result); + }); + it("mock setup method callback throws", () => { + // arrange + const target = { a() { return 1; } }; + const error = new Error("error"); + const mock = new Mock(target, { a(): number { throw error; } }); + + // act + const e = recordError(() => mock.value.a()); + + // assert + assert.strictEqual(error, e); + }); + it("mock setup new property", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target, { b: 2 }); + + // act + const result = (mock.value).b; + + // assert + assert.equal(2, result); + }); + it("mock setup new method", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target, { b() { return 2; } }); + + // act + const result = (mock.value).b(); + + // assert + assert.equal(2, result); + }); + it("mock verify get no setups, not called throws", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); + + // act + const e = recordError(() => mock.verify(_ => _.a, Times.once())); + + // assert + assert.instanceOf(e, Error); + }); + it("mock verify get no setups, called passes", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); + const result = mock.value.a; + + // act + const e = recordError(() => mock.verify(_ => _.a, Times.once())); + + // assert + assert.isUndefined(e); + }); + it("mock verify setup get, called passes", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target, { get a() { return 2 } }); + const result = mock.value.a; + + // act + const e = recordError(() => mock.verify(_ => _.a, Times.once())); + + // assert + assert.isUndefined(e); + }); + it("mock verify method no setups, not called throws", () => { + // arrange + const target = { a() { return 1; } }; + const mock = new Mock(target); + + // act + const e = recordError(() => mock.verify(_ => _.a(), Times.once())); + + // assert + assert.instanceOf(e, Error); + }); + it("mock verify method no setups, called passes", () => { + // arrange + const target = { a() { return 1; } }; + const mock = new Mock(target); + const result = mock.value.a(); + + // act + const e = recordError(() => mock.verify(_ => _.a(), Times.once())); + + // assert + assert.isUndefined(e); + }); + it("mock verify setup method, called passes", () => { + // arrange + const target = { a(x: number) { return x + 1; } }; + const mock = new Mock(target, { + a(x: number) { + return x + 2; + } + }); + const result = mock.value.a(3); + + // act + const e = recordError(() => mock.verify(_ => _.a(Arg.number()), Times.once())); + + // assert + assert.isUndefined(e); + }); + it("mock setup method using callback", () => { + // arrange + const mock = new Mock<{ a(x: number): number; }>(); + mock.setup(_ => _.a(1), { returns: 2 }); + + // act + const result = mock.value.a(1); + + // assert + assert.strictEqual(result, 2); + }); + it("mock setup setter/getter using callback", () => { + // arrange + const mock = new Mock<{ a: number }>(); + mock.setup(_ => _.a, { returns: 2 }); + mock.setup(_ => _.a = Arg.any()); + + // act + const result = mock.value.a; + mock.value.a = 3; + + // assert + assert.strictEqual(result, 2); + }); + it("mock setup getter only using callback", () => { + // arrange + const mock = new Mock<{ a: number }>(); + mock.setup(_ => _.a, { returns: 2 }); + + // act + const result = mock.value.a; + const err = recordError(() => mock.value.a = 3); + + // assert + assert.strictEqual(result, 2); + assert.instanceOf(err, Error); + }); + it("mock setup setter only using callback", () => { + // arrange + const mock = new Mock<{ a: number }>(); + mock.setup(_ => _.a = 2); + + // act + const err1 = recordError(() => mock.value.a); + const err2 = recordError(() => mock.value.a = 2); + const err3 = recordError(() => mock.value.a = 3); + + // assert + assert.instanceOf(err1, Error); + assert.isUndefined(err2); + assert.instanceOf(err3, Error); + }); + it("mock setup function only using callback", () => { + // arrange + const mock = new Mock<(x: number) => number>(x => 0); + mock.setup(_ => _(Arg.number()), { returns: 2 }); + + // act + const result = mock.value(1); + + // assert + assert.strictEqual(result, 2); + }); +}); \ No newline at end of file diff --git a/scripts/typemock/src/tests/sourceMapSupport.ts b/scripts/typemock/src/tests/sourceMapSupport.ts new file mode 100644 index 0000000000000..475edf419f792 --- /dev/null +++ b/scripts/typemock/src/tests/sourceMapSupport.ts @@ -0,0 +1,3 @@ +import { install } from "source-map-support"; + +install(); \ No newline at end of file diff --git a/scripts/typemock/src/tests/stubTests.ts b/scripts/typemock/src/tests/stubTests.ts new file mode 100644 index 0000000000000..53ea8da20c777 --- /dev/null +++ b/scripts/typemock/src/tests/stubTests.ts @@ -0,0 +1,79 @@ +import "./sourceMapSupport"; +import { Mock } from "../mock"; +import { Stub } from "../stub"; +import { Times } from "../times"; +import { assert } from "chai"; + +describe("stub", () => { + it("stub install replaces value", () => { + // arrange + const mock = new Mock({ a: 1 }); + const stub = new Stub(mock.value, "a", 2); + + // act + stub.install(); + + // assert + mock.verify(_ => _.a = 2, Times.once()); + }); + it("stub install is installed", () => { + // arrange + const mock = new Mock({ a: 1 }); + const stub = new Stub(mock.value, "a", 2); + + // act + stub.install(); + + // assert + assert.isTrue(stub.installed); + }); + it("stub install twice only installs once", () => { + // arrange + const mock = new Mock({ a: 1 }); + const stub = new Stub(mock.value, "a", 2); + + // act + stub.install(); + stub.install(); + + // assert + mock.verify(_ => _.a = 2, Times.once()); + }); + it("stub uninstall restores value", () => { + // arrange + const mock = new Mock({ a: 1 }); + const stub = new Stub(mock.value, "a", 2); + stub.install(); + + // act + stub.uninstall(); + + // assert + mock.verify(_ => _.a = 1, Times.once()); + }); + it("stub uninstall is not installed", () => { + // arrange + const mock = new Mock({ a: 1 }); + const stub = new Stub(mock.value, "a", 2); + stub.install(); + + // act + stub.uninstall(); + + // assert + assert.isFalse(stub.installed); + }); + it("stub uninstall twice only uninstalls once", () => { + // arrange + const mock = new Mock({ a: 1 }); + const stub = new Stub(mock.value, "a", 2); + stub.install(); + + // act + stub.uninstall(); + stub.uninstall(); + + // assert + mock.verify(_ => _.a = 1, Times.once()); + }); +}); diff --git a/scripts/typemock/src/tests/timersTests.ts b/scripts/typemock/src/tests/timersTests.ts new file mode 100644 index 0000000000000..5d3b9d7917a27 --- /dev/null +++ b/scripts/typemock/src/tests/timersTests.ts @@ -0,0 +1,305 @@ +import "./sourceMapSupport"; +import { Spy } from "../spy"; +import { Arg } from "../arg"; +import { Times } from "../times"; +import { Timers } from "../timers"; +import { assert } from "chai"; + +describe("timers", () => { + describe("immediate", () => { + it("set adds entry, does not invoke", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + const handle = target.setImmediate(spy.value); + const pending = target.getPending(); + + // assert + assert.strictEqual(pending.length, 1); + assert.strictEqual(pending[0].kind, "immediate"); + assert.isDefined(handle); + spy.called(Times.none()); + }); + it("set/clear", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + const handle = target.setImmediate(spy.value); + target.clearImmedate(handle); + const pending = target.getPending(); + + // assert + assert.strictEqual(pending.length, 0); + spy.called(Times.none()); + }); + it("set one and execute", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.setImmediate(spy.value); + const count = target.executeImmediates(); + + // assert + assert.strictEqual(count, 1); + spy.called(Times.once()); + }); + it("set one with arg and execute", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.setImmediate(spy.value, "a"); + const count = target.executeImmediates(); + + // assert + assert.strictEqual(count, 1); + spy.verify(_ => _(Arg.typeof("string")), Times.once()); + }); + it("nested with maxDepth = 0", () => { + // arrange + const target = new Timers(); + const spy = new Spy(() => { target.setImmediate(spy.value); }); + + // act + target.setImmediate(spy.value); + const count = target.executeImmediates(/*maxDepth*/ 0); + + // assert + assert.strictEqual(count, 1); + spy.called(Times.once()); + }); + it("nested with maxDepth = 1", () => { + // arrange + const target = new Timers(); + const spy = new Spy(() => { target.setImmediate(spy.value); }); + + // act + target.setImmediate(spy.value); + const count = target.executeImmediates(/*maxDepth*/ 1); + + // assert + assert.strictEqual(count, 2); + spy.called(Times.exactly(2)); + }); + }); + describe("timeout", () => { + it("set adds entry, does not invoke", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + const handle = target.setTimeout(spy.value, 0); + const pending = target.getPending(); + + // assert + assert.strictEqual(pending.length, 1); + assert.strictEqual(pending[0].kind, "timeout"); + assert.isDefined(handle); + spy.called(Times.none()); + }); + it("set/clear", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + const handle = target.setTimeout(spy.value, 0); + target.clearTimeout(handle); + const pending = target.getPending(); + + // assert + assert.strictEqual(pending.length, 0); + spy.called(Times.none()); + }); + it("set adds future entry, advance prior to due does not invoke", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.setTimeout(spy.value, 10); + const count = target.advance(9); + + // assert + assert.strictEqual(count, 0); + spy.called(Times.none()); + }); + it("set adds future entry, advance to due invokes", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.setTimeout(spy.value, 10); + const count = target.advance(10); + + // assert + assert.strictEqual(count, 1); + spy.called(Times.once()); + }); + it("5 nested sets throttle", () => { + // arrange + const target = new Timers(); + const spy = new Spy(() => { target.setTimeout(spy.value, 0); }); + + // act + target.setTimeout(spy.value, 0); + const count = target.advance(1); + + // assert + assert.strictEqual(count, 5); + spy.called(Times.exactly(5)); + }); + }); + describe("interval", () => { + it("set adds entry, does not invoke", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + const handle = target.setInterval(spy.value, 0); + const pending = target.getPending({ kind: "interval", ms: 10 }); + + // assert + assert.strictEqual(pending.length, 1); + assert.strictEqual(pending[0].kind, "interval"); + assert.strictEqual(pending[0].interval, 10); + assert.isDefined(handle); + spy.called(Times.none()); + }); + it("set/clear", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + const handle = target.setInterval(spy.value, 0); + target.clearInterval(handle); + const pending = target.getPending({ kind: "interval", ms: 10 }); + + // assert + assert.strictEqual(pending.length, 0); + spy.called(Times.none()); + }); + it("set adds future entry, advance prior to due does not invoke", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.setInterval(spy.value, 10); + const count = target.advance(9); + + // assert + assert.strictEqual(count, 0); + spy.called(Times.none()); + }); + it("set adds future entry, advance to due invokes", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.setInterval(spy.value, 10); + const count = target.advance(10); + + // assert + assert.strictEqual(count, 1); + spy.called(Times.once()); + }); + it("set adds future entry, advance to due twice invokes twice", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.setInterval(spy.value, 10); + const count = target.advance(20); + + // assert + assert.strictEqual(count, 2); + spy.called(Times.exactly(2)); + }); + it("set adds future entry, remove before second due time", () => { + // arrange + const target = new Timers(); + const spy = new Spy(() => { target.clearInterval(handle); }); + + // act + const handle = target.setInterval(spy.value, 10); + const count = target.advance(20); + + // assert + assert.strictEqual(count, 1); + spy.called(Times.exactly(1)); + }); + }); + describe("frame", () => { + it("request adds entry, does not invoke", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + const handle = target.requestAnimationFrame(spy.value); + const pending = target.getPending({ ms: 16 }); + + // assert + assert.strictEqual(pending.length, 1); + assert.strictEqual(pending[0].kind, "frame"); + assert.isDefined(handle); + spy.called(Times.none()); + }); + it("request/cancel", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + const handle = target.requestAnimationFrame(spy.value); + target.cancelAnimationFrame(handle); + const pending = target.getPending(); + + // assert + assert.strictEqual(pending.length, 0); + spy.called(Times.none()); + }); + it("request and advance past one frame", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.requestAnimationFrame(spy.value); + const count = target.advance(16); + + // assert + assert.strictEqual(count, 1); + spy.called(Times.once()); + }); + it("requests clamped to 16ms", () => { + // arrange + const target = new Timers(); + const spy = new Spy(); + + // act + target.requestAnimationFrame(spy.value); + target.advance(10); + target.requestAnimationFrame(spy.value); + const count = target.advance(16); + + // assert + assert.strictEqual(count, 2); + spy.called(Times.exactly(2)); + }); + }); +}); \ No newline at end of file diff --git a/scripts/typemock/src/tests/timesTests.ts b/scripts/typemock/src/tests/timesTests.ts new file mode 100644 index 0000000000000..4cce2500cb713 --- /dev/null +++ b/scripts/typemock/src/tests/timesTests.ts @@ -0,0 +1,236 @@ +import "./sourceMapSupport"; +import { Times } from "../times"; +import { theory, recordError } from "./utils"; +import { assert } from "chai"; + +describe("times", () => { + function makeTimesNoneValidationData(): any[][]{ + return [ + [0, true], + [1, false] + ]; + } + + theory("Times.none validation", makeTimesNoneValidationData, function (count: number, expected: boolean): void { + // arrange + const times = Times.none(); + + // act + const result = times.validate(count); + + // assert + assert.equal(expected, result); + }); + + function makeTimesOnceValidationData(): any[][]{ + return [ + [0, false], + [1, true], + [2, false] + ]; + } + + theory("Times.once validation", makeTimesOnceValidationData, function (count: number, expected: boolean): void { + // arrange + const times = Times.once(); + + // act + const result = times.validate(count); + + // assert + assert.equal(expected, result); + }); + + function makeTimesAtLeastOnceValidationData(): any[] { + return [ + [0, false], + [1, true], + [2, true] + ]; + } + + theory("Times.atLeastOnce validation", makeTimesAtLeastOnceValidationData, function (count: number, expected: boolean): void { + // arrange + const times = Times.atLeastOnce(); + + // act + const result = times.validate(count); + + // assert + assert.equal(expected, result); + }); + + function makeTimesAtMostOnceValidationData(): any[][]{ + return [ + [0, true], + [1, true], + [2, false] + ]; + } + + theory("Times.atMostOnce validation", makeTimesAtMostOnceValidationData, function (count: number, expected: boolean): void { + // arrange + const times = Times.atMostOnce(); + + // act + const result = times.validate(count); + + // assert + assert.equal(expected, result); + }); + + function makeTimesExactlyValidationData(): any[][]{ + return [ + [0, 0, true], + [0, 1, false], + [1, 0, false], + [1, 1, true]]; + } + + theory("Times.exactly validation", makeTimesExactlyValidationData, function (expectedCount: number, count: number, expectedResult: boolean): void { + // arrange + const times = Times.exactly(expectedCount); + + // act + const result = times.validate(count); + + // assert + assert.equal(expectedResult, result); + }); + + function makeTimesAtLeastValidationData(): any[][]{ + return [ + [0, 0, true], + [0, 1, true], + [1, 0, false], + [1, 1, true], + [1, 2, true] + ]; + } + + theory("Times.atLeast validation", makeTimesAtLeastValidationData, function (expectedCount: number, count: number, expectedResult: boolean): void { + // arrange + const times = Times.atLeast(expectedCount); + + // act + const result = times.validate(count); + + // assert + assert.equal(expectedResult, result); + }); + + function makeTimesAtMostValidationData(): any[][]{ + return [ + [0, 0, true], + [0, 1, false], + [1, 0, true], + [1, 1, true], + [1, 2, false] + ]; + } + + theory("Times.atMost validation", makeTimesAtMostValidationData, function (expectedCount: number, count: number, expectedResult: boolean): void { + // arrange + const times = Times.atMost(expectedCount); + + // act + const result = times.validate(count); + + // assert + assert.equal(expectedResult, result); + }); + + function makeTimesBetweenValidationData(): any[][]{ + return [ + [1, 2, 0, false], + [1, 2, 1, true], + [1, 2, 2, true], + [1, 2, 3, false] + ]; + } + + theory("Times.between validation", makeTimesBetweenValidationData, function (min: number, max: number, count: number, expectedResult: boolean): void { + // arrange + const times = Times.between(min, max); + + // act + const result = times.validate(count); + + // assert + assert.equal(expectedResult, result); + }); + + function makeTimesToStringData(): any[][]{ + return [ + [Times.none(), ""], + [Times.once(), ""], + [Times.atLeastOnce(), ""], + [Times.atMostOnce(), ""], + [Times.atLeast(2), ""], + [Times.atMost(2), ""], + [Times.exactly(2), ""], + [Times.between(1, 2), ""] + ]; + } + + theory("Times.toString", makeTimesToStringData, function (times: Times, expected: string): void { + // arrange + // act + const result = times.toString(); + + // assert + assert.equal(expected, result); + }); + + function makeTimesCheckThrowsData(): any[][]{ + return [ + [Times.none(), 1], + [Times.once(), 0], + [Times.once(), 2], + [Times.atLeastOnce(), 0], + [Times.atMostOnce(), 2], + [Times.atLeast(2), 1], + [Times.atMost(2), 3], + [Times.exactly(1), 0], + [Times.exactly(1), 2], + [Times.between(1, 2), 0], + [Times.between(1, 2), 3] + ] + } + + theory("Times.check throws", makeTimesCheckThrowsData, (times: Times, count: number) => { + // arrange + // act + const e = recordError(() => times.check(count, "test")); + + // assert + assert.instanceOf(e, Error); + }); + + function makeTimesCheckPassesData(): any[][] { + return [ + [Times.none(), 0], + [Times.once(), 1], + [Times.atLeastOnce(), 1], + [Times.atLeastOnce(), 2], + [Times.atMostOnce(), 1], + [Times.atMostOnce(), 0], + [Times.atLeast(2), 2], + [Times.atLeast(2), 3], + [Times.atMost(2), 2], + [Times.atMost(2), 1], + [Times.exactly(1), 1], + [Times.between(1, 2), 1], + [Times.between(1, 2), 2] + ]; + } + + theory("Times.check passes", makeTimesCheckPassesData, (times: Times, count: number) => { + // arrange + // act + const e = recordError(() => times.check(count, "test")); + + // assert + assert.isUndefined(e); + }); +}); \ No newline at end of file diff --git a/scripts/typemock/src/tests/utils.ts b/scripts/typemock/src/tests/utils.ts new file mode 100644 index 0000000000000..d28423a288776 --- /dev/null +++ b/scripts/typemock/src/tests/utils.ts @@ -0,0 +1,17 @@ +export function theory(name: string, data: any[][] | (() => any[][]), callback: (...args: any[]) => any) { + describe(name, () => { + for (const row of typeof data === "function" ? data() : data) { + it(row.toString(), () => callback(...row)); + } + }); +} + +export function recordError(action: () => void): Error | undefined { + try { + action(); + return undefined; + } + catch (e) { + return e; + } +} \ No newline at end of file diff --git a/scripts/typemock/src/timers.ts b/scripts/typemock/src/timers.ts new file mode 100644 index 0000000000000..7811290b6d3ea --- /dev/null +++ b/scripts/typemock/src/timers.ts @@ -0,0 +1,475 @@ +export interface Immediate { + readonly kind: "immediate"; + readonly handle: number; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; +} + +export interface Timeout { + readonly kind: "timeout"; + readonly handle: number; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; +} + +export interface Interval { + readonly kind: "interval"; + readonly handle: number; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; + readonly interval: number; +} + +export interface AnimationFrame { + readonly kind: "frame"; + readonly handle: number; + readonly callback: (time: number) => void; +} + +export type Timer = Immediate | Timeout | Interval | AnimationFrame; + +type NonImmediateTimer = Timeout | Interval | AnimationFrame; + +interface Due { + timer: T; + due: number; + depth?: number; + enabled?: boolean; + timeline?: boolean; +} + +const MAX_INT32 = 2 ** 31 - 1; +const MIN_TIMEOUT_VALUE = 4; +const CLAMP_TIMEOUT_NESTING_LEVEL = 5; + +/** + * Programmatic control over timers. + */ +export class Timers { + public static readonly MAX_DEPTH = MAX_INT32; + + private _nextHandle = 1; + private _immediates = new Map>(); + private _timeouts = new Map>(); + private _intervals = new Map>(); + private _frames = new Map>(); + private _timeline: Due[] = []; + private _time: number; + private _depth = 0; + + constructor() { + this._time = 0; + + // bind each timer method so that it can be detached from this instance. + this.setImmediate = this.setImmediate.bind(this); + this.clearImmedate = this.clearImmedate.bind(this); + this.setTimeout = this.setTimeout.bind(this); + this.clearTimeout = this.clearTimeout.bind(this); + this.setInterval = this.setInterval.bind(this); + this.clearInterval = this.clearInterval.bind(this); + this.requestAnimationFrame = this.requestAnimationFrame.bind(this); + this.cancelAnimationFrame = this.cancelAnimationFrame.bind(this); + } + + /** + * Get the current time. + */ + public get time(): number { + return this._time; + } + + /** + * Gets the time of the last scheduled timer (not including repeating intervals). + */ + public get endTime(): number { + return this._timeline && this._timeline.length > 0 + ? this._timeline[this._timeline.length - 1].due + : this._time; + } + + /** + * Gets the estimated time remaining. + */ + public get remainingTime(): number { + return this.endTime - this.time; + } + + public getPending(options: { kind: "immediate", ms?: number }): Immediate[]; + public getPending(options: { kind: "timeout", ms?: number }): Timeout[]; + public getPending(options: { kind: "interval", ms?: number }): Interval[]; + public getPending(options: { kind: "frame", ms?: number }): AnimationFrame[]; + public getPending(options?: { kind?: Timer["kind"], ms?: number }): Timer[]; + public getPending(options: { kind?: Timer["kind"], ms?: number } = {}): Timer[] { + const { kind, ms = 0 } = options; + if (ms < 0) throw new TypeError("Argument 'ms' out of range."); + + const dueTimers: Due[] = []; + + if (!kind || kind === "immediate") { + this.copyImmediates(dueTimers); + } + + if (kind !== "immediate") { + this.copyTimelineBefore(dueTimers, this._time + ms, kind); + } + + return dueTimers.map(dueTimer => dueTimer.timer); + } + + /** + * Advance the current time and trigger callbacks, returning the number of callbacks triggered. + * @param ms The number of milliseconds to advance. + * @param maxDepth The maximum depth for nested `setImmediate` calls to continue processing. + * - Use `0` (default) to disable processing of nested `setImmediate` calls. + * - Use `Timers.MAX_DEPTH` to continue processing nested `setImmediate` calls up to the maximum depth. + */ + public advance(ms: number, maxDepth = 0): number { + if (ms <= 0) throw new TypeError("Argument 'ms' out of range."); + if (maxDepth < 0) throw new TypeError("Argument 'maxDepth' out of range."); + let count = 0; + const endTime = this._time + (ms | 0); + while (true) { + count += this.executeImmediates(maxDepth); + const dueTimer = this.dequeueIfBefore(endTime); + if (dueTimer) { + this._time = dueTimer.due; + this.executeTimer(dueTimer); + count++; + } + else { + this._time = endTime; + return count; + } + } + } + + /** + * Advance the current time to the estimated end time and trigger callbacks, returning the number of callbacks triggered. + * @param maxDepth The maximum depth for nested `setImmediate` calls to continue processing. + * - Use `0` (default) to disable processing of nested `setImmediate` calls. + * - Use `Timers.MAX_DEPTH` to continue processing nested `setImmediate` calls up to the maximum depth. + */ + public advanceToEnd(maxDepth = 0) { + return this.remainingTime > 0 ? this.advance(this.remainingTime, maxDepth) : 0; + } + + /** + * Execute any pending immediate timers, returning the number of timers triggered. + * @param maxDepth The maximum depth for nested `setImmediate` calls to continue processing. + * - Use `0` (default) to disable processing of nested `setImmediate` calls. + * - Use `Timers.MAX_DEPTH` to continue processing nested `setImmediate` calls up to the maximum depth. + */ + public executeImmediates(maxDepth = 0): number { + if ((maxDepth |= 0) < 0) throw new TypeError("Argument 'maxDepth' out of range."); + const dueTimers: Due[] = []; + this.copyImmediates(dueTimers); + let count = this.executeTimers(dueTimers); + for (let depth = 0; depth < maxDepth && this._immediates.size > 0; depth++) { + count += this.executeImmediates(); + } + return count; + } + + public setImmediate(callback: (...args: any[]) => void, ...args: any[]): any { + if (this._depth >= Timers.MAX_DEPTH) { + throw new Error("callback nested too deeply."); + } + + const timer: Immediate = { kind: "immediate", handle: this._nextHandle++, callback, args }; + const dueTimer: Due = { timer, due: -1 }; + this.addTimer(this._immediates, dueTimer); + return timer.handle; + } + + public clearImmedate(timerId: any): void { + const dueTimer = this._immediates.get(timerId); + if (dueTimer) { + this.deleteTimer(this._immediates, dueTimer); + } + } + + public setTimeout(callback: (...args: any[]) => void, timeout: number, ...args: any[]): any { + if (this._depth >= Timers.MAX_DEPTH) { + throw new Error("callback nested too deeply."); + } + + if ((timeout |= 0) < 0) timeout = 0; + + if (this._depth >= CLAMP_TIMEOUT_NESTING_LEVEL && timeout < MIN_TIMEOUT_VALUE) { + timeout = MIN_TIMEOUT_VALUE; + } + + const timer: Timeout = { kind: "timeout", handle: this._nextHandle++, callback, args }; + const dueTimer: Due = { timer, due: this._time + timeout }; + this.addTimer(this._timeouts, dueTimer); + this.addToTimeline(dueTimer); + return timer.handle; + } + + public clearTimeout(timerId: any): void { + const dueTimer = this._timeouts.get(timerId); + if (dueTimer) { + this.deleteTimer(this._timeouts, dueTimer); + this.removeFromTimeline(dueTimer); + } + } + + public setInterval(callback: (...args: any[]) => void, interval: number, ...args: any[]): any { + if (this._depth >= Timers.MAX_DEPTH) { + throw new Error("callback nested too deeply."); + } + + if ((interval |= 0) < 10) interval = 10; + const timer: Interval = { kind: "interval", handle: this._nextHandle++, callback, args, interval }; + const dueTimer: Due = { timer, due: this._time + interval }; + this.addTimer(this._intervals, dueTimer); + this.addToTimeline(dueTimer); + return timer.handle; + } + + public clearInterval(timerId: any): void { + const dueTimer = this._intervals.get(timerId); + if (dueTimer) { + this.deleteTimer(this._intervals, dueTimer); + this.removeFromTimeline(dueTimer); + } + } + + public requestAnimationFrame(callback: (time: number) => void): any { + if (this._depth >= Timers.MAX_DEPTH) { + throw new Error("callback nested too deeply."); + } + + const timer: AnimationFrame = { kind: "frame", handle: this._nextHandle++, callback }; + const dueTimer: Due = { timer, due: this.nextFrameDueTime() }; + this.addTimer(this._frames, dueTimer); + this.addToTimeline(dueTimer); + return timer.handle; + } + + public cancelAnimationFrame(timerId: any): void { + const dueTimer = this._frames.get(timerId); + if (dueTimer) { + this.deleteTimer(this._frames, dueTimer); + this.removeFromTimeline(dueTimer); + } + } + + private nextFrameDueTime() { + return this._time + this.nextFrameDelta(); + } + + private nextFrameDelta() { + return 16 - this._time % 16; + } + + private addTimer(timers: Map>, dueTimer: Due) { + if (dueTimer.enabled) return; + timers.set(dueTimer.timer.handle, dueTimer); + dueTimer.depth = this._depth + 1; + dueTimer.enabled = true; + } + + private deleteTimer(timers: Map>, dueTimer: Due) { + if (!dueTimer.enabled) return; + timers.delete(dueTimer.timer.handle); + dueTimer.enabled = false; + } + + private executeTimers(dueTimers: Due[]) { + let count = 0; + for (const dueTimer of dueTimers) { + this.executeTimer(dueTimer); + count++; + } + return count; + } + + private executeTimer(dueTimer: Due) { + switch (dueTimer.timer.kind) { + case "immediate": return this.executeImmediate(>dueTimer); + case "timeout": return this.executeTimeout(>dueTimer); + case "interval": return this.executeInterval(>dueTimer); + case "frame": return this.executeAnimationFrame(>dueTimer); + } + } + + private executeImmediate(dueTimer: Due) { + if (!dueTimer.enabled) return; + + this.deleteTimer(this._immediates, dueTimer); + this.executeCallback(dueTimer.depth, dueTimer.timer.callback, ...dueTimer.timer.args); + } + + private executeTimeout(dueTimer: Due) { + if (!dueTimer.enabled) return; + + this.deleteTimer(this._timeouts, dueTimer); + this.removeFromTimeline(dueTimer); + this.executeCallback(dueTimer.depth, dueTimer.timer.callback, ...dueTimer.timer.args); + } + + private executeInterval(dueTimer: Due) { + if (!dueTimer.enabled) return; + + this.removeFromTimeline(dueTimer); + this.executeCallback(dueTimer.depth, dueTimer.timer.callback, ...dueTimer.timer.args); + + if (dueTimer.enabled) { + dueTimer.due += dueTimer.timer.interval; + this.addToTimeline(dueTimer); + } + } + + private executeAnimationFrame(dueTimer: Due) { + if (!dueTimer.enabled) return; + + this.deleteTimer(this._frames, dueTimer); + this.removeFromTimeline(dueTimer); + this.executeCallback(dueTimer.depth, dueTimer.timer.callback, this._time); + } + + private executeCallback(depth = 0, callback: (...args: any[]) => void, ...args: any[]) { + const savedDepth = this._depth; + this._depth = depth; + try { + callback(...args); + } + finally { + this._depth = savedDepth; + } + } + + private dequeueIfBefore(dueTime: number) { + if (this._timeline.length > 0) { + const dueTimer = this._timeline[0]; + if (dueTimer.due <= dueTime) { + this._timeline.shift(); + dueTimer.timeline = false; + return dueTimer; + } + } + } + + private copyImmediates(dueTimers: Due[]) { + for (const dueTimer of this._immediates.values()) { + dueTimers.push(dueTimer); + } + } + + private copyTimelineBefore(dueTimers: Due[], dueTime: number, kind?: Timer["kind"]) { + for (const dueTimer of this._timeline) { + if (dueTimer.due <= dueTime && (!kind || dueTimer.timer.kind === kind)) { + dueTimers.push(dueTimer); + } + } + } + + private addToTimeline(dueTimer: Due) { + if (dueTimer.timeline) return; + + let index = binarySearch(this._timeline, dueTimer, getDueTime, compareTimestamps); + if (index < 0) { + index = ~index; + } + else { + while (index < this._timeline.length) { + if (this._timeline[index].due > dueTimer.due) { + break; + } + index++; + } + } + + insertAt(this._timeline, index, dueTimer); + dueTimer.timeline = true; + } + + private removeFromTimeline(dueTimer: Due) { + if (dueTimer.timeline) { + let index = binarySearch(this._timeline, dueTimer, getDueTime, compareTimestamps); + if (index >= 0) { + while (index < this._timeline.length) { + const event = this._timeline[index]; + if (event === dueTimer) { + removeAt(this._timeline, index); + dueTimer.timeline = false; + return true; + } + if (event.due > dueTimer.due) { + break; + } + index++; + } + } + } + return false; + } +} + +function getDueTime(v: Due) { + return v.due; +} + +function compareTimestamps(a: number, b: number) { + return a - b; +} + +function binarySearch(array: ReadonlyArray, value: T, keySelector: (v: T) => U, keyComparer: (a: U, b: U) => number): number { + if (array.length === 0) { + return -1; + } + + let low = 0; + let high = array.length - 1; + const key = keySelector(value); + while (low <= high) { + const middle = low + ((high - low) >> 1); + const midKey = keySelector(array[middle]); + const result = keyComparer(midKey, key); + if (result < 0) { + low = middle + 1; + } + else if (result > 0) { + high = middle - 1; + } + else { + return middle; + } + } + + return ~low; +} + +function removeAt(array: T[], index: number): void { + if (array.length === 0) { + return; + } + else if (index === 0) { + array.shift(); + } + else if (index === array.length - 1) { + array.pop(); + } + else { + for (let i = index; i < array.length - 1; i++) { + array[i] = array[i + 1]; + } + array.length--; + } +} + +function insertAt(array: T[], index: number, value: T): void { + if (index === 0) { + array.unshift(value); + } + else if (index === array.length) { + array.push(value); + } + else { + for (let i = array.length; i > index; i--) { + array[i] = array[i - 1]; + } + array[index] = value; + } +} \ No newline at end of file diff --git a/scripts/typemock/src/times.ts b/scripts/typemock/src/times.ts new file mode 100644 index 0000000000000..318d4702dc43f --- /dev/null +++ b/scripts/typemock/src/times.ts @@ -0,0 +1,120 @@ +/** + * Defines the number of times an action must have been executed during verification of a Mock. + */ +export class Times { + private static _none: Times | undefined; + private static _once: Times | undefined; + private static _atLeastOnce: Times | undefined; + private static _atMostOnce: Times | undefined; + + private _min: number; + private _max: number; + private _message: string; + + private constructor(min: number, max: number, message: string) { + this._min = min; + this._max = max; + this._message = message; + } + + /** + * Expects that an action was never executed. + * @returns A new `Times` instance. + */ + public static none(): Times { + return this._none || (this._none = new Times(0, 0, `never`)); + } + + /** + * Expects that an action was executed exactly once. + * @returns A new `Times` instance. + */ + public static once(): Times { + return this._once || (this._once = new Times(1, 1, `exactly once`)); + } + + /** + * Expects that an action was executed at least once. + * @returns A new `Times` instance. + */ + public static atLeastOnce(): Times { + return this._atLeastOnce || (this._atLeastOnce = new Times(1, Number.MAX_SAFE_INTEGER, `at least once`)); + } + + /** + * Expects that an action was executed at least the specified number of times. + * @param count The number of times. + * @returns A new `Times` instance. + */ + public static atLeast(count: number): Times { + return new Times(count, Number.MAX_SAFE_INTEGER, `at least ${count} time(s)`); + } + + /** + * Expects that an action was executed exactly the specified number of times. + * @param count The number of times. + * @returns A new `Times` instance. + */ + public static exactly(count: number): Times { + return new Times(count, count, `exactly ${count} time(s)`); + } + + /** + * Expects that an action was executed at most the specified number of times. + * @param count The number of times. + * @returns A new `Times` instance. + */ + public static atMost(count: number): Times { + return new Times(0, count, `at most ${count} time(s)`); + } + + /** + * Expects that an action was executed at most once. + * @returns A new `Times` instance. + */ + public static atMostOnce(): Times { + return this._atMostOnce || (this._atMostOnce = new Times(0, 1, `at most once`)); + } + + /** + * Expects that an action was executed between a range of times, inclusive. + * @param min The minimum number of times, inclusive. + * @param max The maximum number of times, inclusive. + * @returns A new `Times` instance. + */ + public static between(min: number, max: number): Times { + return new Times(min, max, `between ${min} and ${max} time(s)`); + } + + /** + * Validates the number of times an action was executed. + * @param count The number of times the action was executed. + * @returns `true` if the provided count was valid; otherwise, `false`. + */ + public validate(count: number): boolean { + if (count < this._min) return false; + if (count > this._max) return false; + return true; + } + + /** + * Checks the number of times an action was executed, throwing an error if the count was not valid. + * @param count The number of times the action was executed. + * @param message The message to use to begin the check. + */ + public check(count: number, message: string): void { + if (!this.validate(count)) { + const expectedMessage = this._message === `never` + ? `Expected to never be executed.` + : `Expected to be executed ${this._message}.`; + throw new Error(`${message}\n${expectedMessage} Actually executed ${count} time(s).`); + } + } + + /** + * Gets the string representation of this object. + */ + public toString(): string { + return `<${this._message}>`; + } +} diff --git a/scripts/typemock/src/tsconfig.json b/scripts/typemock/src/tsconfig.json new file mode 100644 index 0000000000000..23d6c614dbc70 --- /dev/null +++ b/scripts/typemock/src/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es2017", + "strict": true, + "declaration": true, + "sourceMap": true, + "types": ["mocha"] + } +} \ No newline at end of file diff --git a/src/harness/core.ts b/src/harness/core.ts index 10e5bb7a11b8a..9498877495561 100644 --- a/src/harness/core.ts +++ b/src/harness/core.ts @@ -191,6 +191,10 @@ namespace core { } } + public [Symbol.iterator]() { + return this.entries(); + } + private writePreamble() { if (this._copyOnWrite) { this._keys = this._keys.slice(); @@ -211,6 +215,109 @@ namespace core { } } + export class SortedSet implements ReadonlySet { + private _comparer: (a: T, b: T) => number; + private _values: T[] = []; + private _version = 0; + private _copyOnWrite = false; + + constructor(comparer: (a: T, b: T) => number) { + this._comparer = comparer; + } + + public get size() { + return this._values.length; + } + + public has(value: T) { + return binarySearch(this._values, value, identity, this._comparer) >= 0; + } + + public add(value: T) { + const index = binarySearch(this._values, value, identity, this._comparer); + if (index < 0) { + this.writePreamble(); + insertAt(this._values, ~index, value); + this.writePostScript(); + } + return this; + } + + public delete(value: T) { + const index = binarySearch(this._values, value, identity, this._comparer); + if (index >= 0) { + this.writePreamble(); + removeAt(this._values, index); + this.writePostScript(); + return true; + } + return false; + } + + public clear() { + if (this.size > 0) { + this.writePreamble(); + this._values.length = 0; + this.writePostScript(); + } + } + + public forEach(callback: (value: T, key: T, collection: this) => void) { + const values = this._values; + const version = this._version; + this._copyOnWrite = true; + for (const value of values) { + callback(value, value, this); + } + if (version === this._version) { + this._copyOnWrite = false; + } + } + + public keys() { + return this.values(); + } + + public * values() { + const values = this._values; + const version = this._version; + this._copyOnWrite = true; + for (const value of values) { + yield value; + } + if (version === this._version) { + this._copyOnWrite = false; + } + } + + public * entries() { + const values = this._values; + const version = this._version; + this._copyOnWrite = true; + for (const value of values) { + yield [value, value] as [T, T]; + } + if (version === this._version) { + this._copyOnWrite = false; + } + } + + public [Symbol.iterator]() { + return this.values(); + } + + private writePreamble() { + if (this._copyOnWrite) { + this._values = this._values.slice(); + this._copyOnWrite = false; + } + } + + private writePostScript() { + this._version++; + } + } + /** * A collection of metadata that supports inheritance. */ @@ -314,11 +421,21 @@ namespace core { } export function removeAt(array: T[], index: number): void { - for (let i = index; i < array.length - 1; i++) { - array[i] = array[i + 1]; + if (index < 0 || index >= array.length) { + return; + } + else if (index === 0) { + array.shift(); + } + else if (index === array.length - 1) { + array.pop(); + } + else { + for (let i = index; i < array.length - 1; i++) { + array[i] = array[i + 1]; + } + array.length--; } - - array.length--; } export function insertAt(array: T[], index: number, value: T): void { diff --git a/src/harness/mocks.ts b/src/harness/mocks.ts index 315677b7117fd..97ea4b1e0ee07 100644 --- a/src/harness/mocks.ts +++ b/src/harness/mocks.ts @@ -1,209 +1,98 @@ /// -/// import { debug } from "util"; - - +/// +/// +/// // NOTE: The contents of this file are all exported from the namespace 'mocks'. This is to // support the eventual conversion of harness into a modular system. +// harness mocks namespace mocks { - const MAX_INT32 = 2 ** 31 - 1; - - export interface Immediate { - readonly kind: "immediate"; - readonly callback: (...args: any[]) => void; - readonly args: ReadonlyArray; - } - - export interface Timeout { - readonly kind: "timeout"; - readonly callback: (...args: any[]) => void; - readonly args: ReadonlyArray; - readonly due: number; - } - - export interface Interval { - readonly kind: "interval"; - readonly callback: (...args: any[]) => void; - readonly args: ReadonlyArray; - readonly due: number; - readonly interval: number; - } - - export type Timer = Immediate | Timeout | Interval; - - interface InternalInterval extends Interval { - due: number; - } - - /** - * Programmatic control over timers. - */ - export class Timers { - public static readonly MAX_DEPTH = MAX_INT32; - private _immediates = new Set(); - private _timeouts = new Set(); - private _intervals = new Set(); - private _time: number; - - constructor(startTime = Date.now()) { - this._time = startTime; - - // bind each timer method so that it can be detached from this instance. - this.setImmediate = this.setImmediate.bind(this); - this.clearImmedate = this.clearImmedate.bind(this); - this.setTimeout = this.setTimeout.bind(this); - this.clearTimeout = this.clearImmedate.bind(this); - this.setInterval = this.setInterval.bind(this); - this.clearInterval = this.clearInterval.bind(this); - } - + export interface MockServerHostOptions { /** - * Get the current time. + * The `VirtualFleSystem` to use. If not specified, a new case-sensitive `VirtualFileSystem` + * is created. */ - public get time(): number { - return this._time; - } - - public getPending(kind: "immediate", ms?: number): Immediate[]; - public getPending(kind: "timeout", ms?: number): Timeout[]; - public getPending(kind: "interval", ms?: number): Interval[]; - public getPending(kind?: Timer["kind"], ms?: number): Timer[]; - public getPending(kind?: Timer["kind"], ms = 0) { - if (ms < 0) throw new TypeError("Argument 'ms' out of range."); - const pending: Timer[] = []; - if (!kind || kind === "immediate") this.appendImmediates(pending); - if (!kind || kind === "timeout") this.appendDueTimeouts(pending, this._time + ms); - if (!kind || kind === "interval") this.appendDueIntervals(pending, this._time + ms, /*expand*/ false); - return core.stableSort(pending, compareTimers); - } - + vfs?: vfs.VirtualFileSystem | { currentDirectory?: string, useCaseSensitiveFileNames?: boolean }; /** - * Advance the current time and trigger callbacks, returning the number of callbacks triggered. - * @param ms The number of milliseconds to advance. - * @param maxDepth The maximum depth for nested `setImmediate` calls to continue processing. - * - Use `0` (default) to disable processing of nested `setImmediate` calls. - * - Use `Timer.NO_MAX_DEPTH` to continue processing all nested `setImmediate` calls. + * The virtual path to tsc.js. If not specified, a default of `"/.ts/tsc.js"` is used. */ - public advance(ms: number, maxDepth = 0): number { - if (ms < 0) throw new TypeError("Argument 'ms' out of range."); - if (maxDepth < 0) throw new TypeError("Argument 'maxDepth' out of range."); - this._time += ms; - return this.executePending(maxDepth); - } - + executingFilePath?: string; /** - * Execute any pending timers, returning the number of timers triggered. - * @param maxDepth The maximum depth for nested `setImmediate` calls to continue processing. - * - Use `0` (default) to disable processing of nested `setImmediate` calls. - * - Use `Timer.NO_MAX_DEPTH` to continue processing all nested `setImmediate` calls. + * The new-line style. If not specified, a default of `"\n"` is used. */ - public executePending(maxDepth = 0): number { - if (maxDepth < 0) throw new TypeError("Argument 'maxDepth' out of range."); - const pending: Timer[] = []; - this.appendImmediates(pending); - this.appendDueTimeouts(pending, this._time); - this.appendDueIntervals(pending, this._time, /*expand*/ true); - let count = this.execute(pending); - for (let depth = 0; depth < maxDepth && this._immediates.size > 0; depth++) { - pending.length = 0; - this.appendImmediates(pending); - count += this.execute(pending); - } - return count; - } - - public setImmediate(callback: (...args: any[]) => void, ...args: any[]): any { - const timer: Immediate = { kind: "immediate", callback, args }; - this._immediates.add(timer); - return timer; - } - - public clearImmedate(timerId: any): void { - this._immediates.delete(timerId); - } - - public setTimeout(callback: (...args: any[]) => void, timeout: number, ...args: any[]): any { - if (timeout < 0) timeout = 0; - const due = this._time + timeout; - const timer: Timeout = { kind: "timeout", callback, args, due }; - this._timeouts.add(timer); - return timer; - } - - public clearTimeout(timerId: any): void { - this._timeouts.delete(timerId); - } - - public setInterval(callback: (...args: any[]) => void, interval: number, ...args: any[]): any { - if (interval < 0) interval = 0; - const due = this._time + interval; - const timer: Interval = { kind: "interval", callback, args, due, interval }; - this._intervals.add(timer); - return timer; - } - - public clearInterval(timerId: any): void { - this._intervals.delete(timerId); - } - - private appendImmediates(pending: Timer[]) { - this._immediates.forEach(timer => { - pending.push(timer); - }); - } - - private appendDueTimeouts(timers: Timer[], dueTime: number) { - this._timeouts.forEach(timer => { - if (timer.due <= dueTime) { - timers.push(timer); - } - }); - } - - private appendDueIntervals(timers: Timer[], dueTime: number, expand: boolean) { - this._intervals.forEach(timer => { - while (timer.due <= dueTime) { - timers.push(timer); - if (!expand) break; - timer.due += timer.interval; - } - }); - } - - private execute(timers: Timer[]) { - for (const timer of core.stableSort(timers, compareTimers)) { - switch (timer.kind) { - case "immediate": this._immediates.delete(timer); break; - case "timeout": this._timeouts.delete(timer); break; - } - const { callback, args } = timer; - callback(...args); - } - return timers.length; - } - } - - function compareTimers(a: Immediate | Timeout, b: Immediate | Timeout) { - return (a.kind === "immediate" ? -1 : a.due) - (b.kind === "immediate" ? -1 : b.due); + newLine?: "\r\n" | "\n"; + /** + * Indicates whether to include _safeList.json_. + */ + safeList?: boolean; + /** + * Indicates whether to include a bare _lib.d.ts_. + */ + lib?: boolean; } export class MockServerHost implements ts.server.ServerHost, ts.FormatDiagnosticsHost { - public readonly exitMessage = "System Exit"; - public readonly timers = new Timers(); + public static readonly defaultExecutingFilePath = "/.ts/tsc.js"; + public static readonly defaultCurrentDirectory = "/"; + public static readonly safeListPath = "/safelist.json"; + public static readonly safeListContent = + `{\n` + + ` "commander": "commander",\n` + + ` "express": "express",\n` + + ` "jquery": "jquery",\n` + + ` "lodash": "lodash",\n` + + ` "moment": "moment",\n` + + ` "chroma": "chroma-js"\n` + + `}`; + + public static readonly libPath = "/.ts/lib.d.ts"; + public static readonly libContent = + `/// \n` + + `interface Boolean {}\n` + + `interface Function {}\n` + + `interface IArguments {}\n` + + `interface Number { toExponential: any; }\n` + + `interface Object {}\n` + + `interface RegExp {}\n` + + `interface String { charAt: any; }\n` + + `interface Array {}`; + + public readonly timers = new typemock.Timers(); public readonly vfs: vfs.VirtualFileSystem; public exitCode: number; + private static readonly processExitSentinel = new Error("System exit"); private readonly _output: string[] = []; private readonly _executingFilePath: string; private readonly _getCanonicalFileName: (file: string) => string; - constructor(vfs: vfs.VirtualFileSystem, executingFilePath = "/.ts/tsc.js", newLine = "\n") { - this.vfs = vfs; - this.useCaseSensitiveFileNames = vfs.useCaseSensitiveFileNames; + constructor(options: MockServerHostOptions = {}) { + const { + vfs: _vfs = {}, + executingFilePath = MockServerHost.defaultExecutingFilePath, + newLine = "\n", + safeList = false, + lib = false + } = options; + + const { currentDirectory = MockServerHost.defaultCurrentDirectory, useCaseSensitiveFileNames = false } = _vfs; + + this.vfs = _vfs instanceof vfs.VirtualFileSystem ? _vfs : + new vfs.VirtualFileSystem(currentDirectory, useCaseSensitiveFileNames); + + this.useCaseSensitiveFileNames = this.vfs.useCaseSensitiveFileNames; this.newLine = newLine; this._executingFilePath = executingFilePath; this._getCanonicalFileName = ts.createGetCanonicalFileName(this.useCaseSensitiveFileNames); + + if (safeList) { + this.vfs.addFile(MockServerHost.safeListPath, MockServerHost.safeListContent); + } + + if (lib) { + this.vfs.addFile(MockServerHost.libPath, MockServerHost.libContent); + } } // #region DirectoryStructureHost members @@ -218,8 +107,8 @@ namespace mocks { return this.vfs.readFile(path); } - public writeFile(path: string, data: string): void { - this.vfs.writeFile(path, data); + public writeFile(path: string, data: string, writeByteOrderMark?: boolean): void { + this.vfs.writeFile(path, writeByteOrderMark ? core.addUTF8ByteOrderMark(data) : data); } public fileExists(path: string) { @@ -250,7 +139,7 @@ namespace mocks { public exit(exitCode?: number) { this.exitCode = exitCode; - throw new Error("System exit"); + throw MockServerHost.processExitSentinel; } // #endregion DirectoryStructureHost members @@ -336,5 +225,26 @@ namespace mocks { public clearOutput() { this._output.length = 0; } + + public checkTimeoutQueueLength(expected: number) { + const callbacksCount = this.timers.getPending({ kind: "timeout", ms: this.timers.remainingTime }).length; + assert.equal(callbacksCount, expected, `expected ${expected} timeout callbacks queued but found ${callbacksCount}.`); + } + + public checkTimeoutQueueLengthAndRun(count: number) { + this.checkTimeoutQueueLength(count); + this.runQueuedTimeoutCallbacks(); + } + + public runQueuedTimeoutCallbacks() { + try { + this.timers.advanceToEnd(); + } + catch (e) { + if (e !== MockServerHost.processExitSentinel) { + throw e; + } + } + } } } \ No newline at end of file diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 11e03438090ae..06bc299d5981d 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -76,6 +76,7 @@ "core.ts", "utils.ts", + "typemock.ts", "events.ts", "documents.ts", "vpath.ts", diff --git a/src/harness/typemock.ts b/src/harness/typemock.ts new file mode 100644 index 0000000000000..32950dfac7412 --- /dev/null +++ b/src/harness/typemock.ts @@ -0,0 +1,98 @@ +/// +/// +/// + +// NOTE: The contents of this file are all exported from the namespace 'typemock'. This is to +// support the eventual conversion of harness into a modular system. + +// typemock library +namespace typemock { + type Imported = T["prototype"]; + + function unwrap(module: any, _: () => PromiseLike): T { return module; } + + const module = unwrap(require("../../scripts/typemock"), () => import("../../scripts/typemock")); + + export const Arg = module.Arg; + + export interface Arg extends Imported { + } + + export interface Returns { + returns: U; + } + + export interface Throws { + throws: any; + } + + export const Mock = module.Mock; + + export interface Mock extends Imported { + readonly value: T; + setup(callback: (value: T) => U, result?: Returns | Throws): Mock; + setup(setups: Partial): Mock; + verify(callback: (value: T) => any, times: Times): Mock; + } + + export type Callable = ((...args: any[]) => any); + + export type Constructable = (new (...args: any[]) => any); + + export const Spy = module.Spy; + + export interface Spy extends Imported { + readonly value: T; + verify(callback: (value: T) => any, times: Times): this; + } + + export const Times = module.Times; + + export interface Times extends Imported { + } + + export interface Immediate { + readonly kind: "immediate"; + readonly handle: number; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; + } + + export interface Timeout { + readonly kind: "timeout"; + readonly handle: number; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; + } + + export interface Interval { + readonly kind: "interval"; + readonly handle: number; + readonly callback: (...args: any[]) => void; + readonly args: ReadonlyArray; + readonly interval: number; + } + + export interface AnimationFrame { + readonly kind: "frame"; + readonly handle: number; + readonly callback: (time: number) => void; + } + + export declare type Timer = Immediate | Timeout | Interval | AnimationFrame; + + export const Timers = module.Timers; + + export interface Timers extends Imported { + } + + export const Stub = module.Stub; + + export interface Stub extends Imported { + readonly target: T; + readonly key: K; + stubValue: T[K]; + readonly originalValue: T[K]; + readonly currentValue: T[K]; + } +} \ No newline at end of file diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index 36f9d1c366bce..12fc812773294 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -1,10 +1,10 @@ /// /// /// +/// /// namespace ts.projectSystem { - import CommandNames = server.CommandNames; const nullCancellationToken = server.nullCancellationToken; function createTestTypingsInstaller(host: server.ServerHost) { @@ -12,26 +12,39 @@ 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)); + interface ProjectFileList { + projectFileName: string; + files: (string | FileOrFolder | vfs.VirtualFile)[]; + } + + function sendAffectedFileRequestAndCheckResult(session: server.Session, args: server.protocol.FileRequestArgs, expectedFileList: ProjectFileList | ProjectFileList[]) { + checkAffectedFiles(sendCompileOnSaveAffectedFileListRequest(session, args), expectedFileList); + } - assert.equal(actualResult.length, expectedFileList.length, `Actual result project number is different from the expected project number`); + function checkAffectedFiles(actualFileList: server.protocol.CompileOnSaveAffectedFileListSingleProject[], expectedFileList: ProjectFileList | ProjectFileList[]) { + actualFileList = sort(actualFileList, compareFileLists); + expectedFileList = Array.isArray(expectedFileList) ? sort(expectedFileList, compareFileLists) : [expectedFileList]; - for (let i = 0; i < actualResult.length; i++) { - const actualResultSingleProject = actualResult[i]; + assert.equal(actualFileList.length, expectedFileList.length, `Actual result project number is different from the expected project number`); + + for (let i = 0; i < actualFileList.length; i++) { + const actualResultSingleProject = actualFileList[i]; const expectedResultSingleProject = expectedFileList[i]; assert.equal(actualResultSingleProject.projectFileName, expectedResultSingleProject.projectFileName, `Actual result contains different projects than the expected result`); - const actualResultSingleProjectFileNameList = actualResultSingleProject.fileNames.sort(); - const expectedResultSingleProjectFileNameList = map(expectedResultSingleProject.files, f => f.path).sort(); + const actualResultSingleProjectFileNameList = sort(actualResultSingleProject.fileNames, compareStringsCaseSensitive); + const expectedFiles = map(expectedResultSingleProject.files, file => typeof file === "string" ? file : file.path); + const expectedResultSingleProjectFileNameList = sort(expectedFiles, compareStringsCaseSensitive); assert.isTrue( arrayIsEqualTo(actualResultSingleProjectFileNameList, expectedResultSingleProjectFileNameList), `For project ${actualResultSingleProject.projectFileName}, the actual result is ${actualResultSingleProjectFileNameList}, while expected ${expectedResultSingleProjectFileNameList}`); } } + function compareFileLists(a: T, b: T) { + return ts.compareStringsCaseSensitive(a.projectFileName, b.projectFileName); + } + function createSession(host: server.ServerHost, typingsInstaller?: server.ITypingsInstaller): server.Session { const opts: server.SessionOptions = { host, @@ -48,105 +61,40 @@ namespace ts.projectSystem { } describe("for configured projects", () => { - let moduleFile1: FileOrFolder; - let file1Consumer1: FileOrFolder; - let file1Consumer2: FileOrFolder; - let moduleFile2: FileOrFolder; - let globalFile3: FileOrFolder; - let configFile: FileOrFolder; - let changeModuleFile1ShapeRequest1: server.protocol.Request; - let changeModuleFile1InternalRequest1: server.protocol.Request; - // A compile on save affected file request using file1 - let moduleFile1FileListRequest: server.protocol.Request; - - let sharedFs: vfs.VirtualFileSystem; - before(() => { - const fs = new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true); - fs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); - fs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); - fs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); - fs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); - fs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); - fs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); - fs.addFile(libFile.path, libFile.content); - fs.makeReadOnly(); - sharedFs = fs; - }); + it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + const file1Consumer2 = host.vfs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + host.vfs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + host.vfs.addFile(libFile.path, libFile.content); - after(() => { - sharedFs = undefined; - }); + const session = createSession(host, createTestTypingsInstaller(host)); - beforeEach(() => { - moduleFile1 = { - path: "/a/b/moduleFile1.ts", - content: "export function Foo() { };" - }; - - file1Consumer1 = { - path: "/a/b/file1Consumer1.ts", - content: `import {Foo} from "./moduleFile1"; export var y = 10;` - }; - - file1Consumer2 = { - path: "/a/b/file1Consumer2.ts", - content: `import {Foo} from "./moduleFile1"; let z = 10;` - }; - - moduleFile2 = { - path: "/a/b/moduleFile2.ts", - content: `export var Foo4 = 10;` - }; - - globalFile3 = { - path: "/a/b/globalFile3.ts", - content: `interface GlobalFoo { age: number }` - }; - - configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compileOnSave": true - }` - }; - - // Change the content of file1 to `export var T: number;export function Foo() { };` - changeModuleFile1ShapeRequest1 = makeSessionRequest(CommandNames.Change, { - file: moduleFile1.path, - line: 1, - offset: 1, - endLine: 1, - endOffset: 1, - insertString: `export var T: number;` - }); + openFilesForSession([moduleFile1.path, file1Consumer1.path], session); - // Change the content of file1 to `export var T: number;export function Foo() { };` - changeModuleFile1InternalRequest1 = makeSessionRequest(CommandNames.Change, { + // Send an initial compileOnSave request + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1.path, file1Consumer1.path, file1Consumer2.path] }); + + sendChangeRequest(session, { file: moduleFile1.path, line: 1, offset: 1, endLine: 1, endOffset: 1, - insertString: `var T1: number;` + insertString: `export var T: number;` }); - moduleFile1FileListRequest = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: moduleFile1.path, projectFileName: configFile.path }); - }); - - it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { - const host = new mocks.MockServerHost(sharedFs.shadow()); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); - - openFilesForSession([moduleFile1, file1Consumer1], session); - - // Send an initial compileOnSave request - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); - session.executeCommand(changeModuleFile1ShapeRequest1); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }); // Change the content of file1 to `export var T: number;export function Foo() { console.log('hi'); };` - const changeFile1InternalRequest = makeSessionRequest(CommandNames.Change, { + sendChangeRequest(session, { file: moduleFile1.path, line: 1, offset: 46, @@ -154,22 +102,33 @@ namespace ts.projectSystem { endOffset: 46, insertString: `console.log('hi');` }); - session.executeCommand(changeFile1InternalRequest); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1] }]); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1] }); }); it("should be up-to-date with the reference map changes", () => { - const host = new mocks.MockServerHost(sharedFs.shadow()); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + const file1Consumer2 = host.vfs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + host.vfs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + host.vfs.addFile(libFile.path, libFile.content); - openFilesForSession([moduleFile1, file1Consumer1], session); + const session = createSession(host, createTestTypingsInstaller(host)); + + openFilesForSession([moduleFile1.path, file1Consumer1.path], session); // Send an initial compileOnSave request - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }); // Change file2 content to `let y = Foo();` - const removeFile1Consumer1ImportRequest = makeSessionRequest(CommandNames.Change, { + sendChangeRequest(session, { file: file1Consumer1.path, line: 1, offset: 1, @@ -177,12 +136,22 @@ namespace ts.projectSystem { endOffset: 28, insertString: "" }); - session.executeCommand(removeFile1Consumer1ImportRequest); - session.executeCommand(changeModuleFile1ShapeRequest1); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer2] }]); + + sendChangeRequest(session, { + file: moduleFile1.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: `export var T: number;` + }); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer2] }); // Add the import statements back to file2 - const addFile2ImportRequest = makeSessionRequest(CommandNames.Change, { + sendChangeRequest(session, { file: file1Consumer1.path, line: 1, offset: 1, @@ -190,10 +159,9 @@ namespace ts.projectSystem { endOffset: 1, insertString: `import {Foo} from "./moduleFile1";` }); - session.executeCommand(addFile2ImportRequest); // Change the content of file1 to `export var T2: string;export var T: number;export function Foo() { };` - const changeModuleFile1ShapeRequest2 = makeSessionRequest(CommandNames.Change, { + sendChangeRequest(session, { file: moduleFile1.path, line: 1, offset: 1, @@ -201,104 +169,175 @@ namespace ts.projectSystem { endOffset: 1, insertString: `export var T2: string;` }); - session.executeCommand(changeModuleFile1ShapeRequest2); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }); }); it("should be up-to-date with changes made in non-open files", () => { - const host = new mocks.MockServerHost(sharedFs.shadow()); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + const file1Consumer2 = host.vfs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + host.vfs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + host.vfs.addFile(libFile.path, libFile.content); + + const session = createSession(host, createTestTypingsInstaller(host)); openFilesForSession([moduleFile1], session); // Send an initial compileOnSave request - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }); host.vfs.writeFile(file1Consumer1.path, `let y = 10;`); - session.executeCommand(changeModuleFile1ShapeRequest1); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer2] }]); + + sendChangeRequest(session, { + file: moduleFile1.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: `export var T: number;` + }); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer2] }); }); it("should be up-to-date with deleted files", () => { - const host = new mocks.MockServerHost(sharedFs.shadow()); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + const file1Consumer2 = host.vfs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + host.vfs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + host.vfs.addFile(libFile.path, libFile.content); + + const session = createSession(host, createTestTypingsInstaller(host)); openFilesForSession([moduleFile1], session); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); - session.executeCommand(changeModuleFile1ShapeRequest1); + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }); + + sendChangeRequest(session, { + file: moduleFile1.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: `export var T: number;` + }); host.vfs.removeFile(file1Consumer2.path); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1] }]); + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1] }); }); it("should be up-to-date with newly created files", () => { - const host = new mocks.MockServerHost(sharedFs.shadow()); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + const file1Consumer2 = host.vfs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + host.vfs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + host.vfs.addFile(libFile.path, libFile.content); + + const session = createSession(host, createTestTypingsInstaller(host)); openFilesForSession([moduleFile1], session); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); - - const file1Consumer3: FileOrFolder = { - path: "/a/b/file1Consumer3.ts", - content: `import {Foo} from "./moduleFile1"; let y = Foo();` - }; - host.vfs.writeFile(file1Consumer3.path, file1Consumer3.content); - session.executeCommand(changeModuleFile1ShapeRequest1); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2, file1Consumer3] }]); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }); + + const file1Consumer3 = host.vfs.addFile("/a/b/file1Consumer3.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); + + sendChangeRequest(session, { + file: moduleFile1.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: `export var T: number;` + }); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2, file1Consumer3] }); }); it("should detect changes in non-root files", () => { - moduleFile1 = { - path: "/a/b/moduleFile1.ts", - content: "export function Foo() { };" - }; - - file1Consumer1 = { - path: "/a/b/file1Consumer1.ts", - content: `import {Foo} from "./moduleFile1"; let y = Foo();` - }; - - configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compileOnSave": true, - "files": ["${file1Consumer1.path}"] - }` - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(moduleFile1.path, moduleFile1.content); - host.vfs.addFile(file1Consumer1.path, file1Consumer1.content); - host.vfs.addFile(configFile.path, configFile.content); + const host = new mocks.MockServerHost(); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ "compileOnSave": true, "files": ["${file1Consumer1.path}"] }`); host.vfs.addFile(libFile.path, libFile.content); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const session = createSession(host, createTestTypingsInstaller(host)); openFilesForSession([moduleFile1, file1Consumer1], session); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1] }]); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1] }); // change file1 shape now, and verify both files are affected - session.executeCommand(changeModuleFile1ShapeRequest1); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1] }]); + sendChangeRequest(session, { + file: moduleFile1.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: `export var T: number;` + }); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1] }); // change file1 internal, and verify only file1 is affected - session.executeCommand(changeModuleFile1InternalRequest1); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1] }]); + sendChangeRequest(session, { + file: moduleFile1.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: `var T1: number;` + }); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1] }); }); it("should return all files if a global file changed shape", () => { - const host = new mocks.MockServerHost(sharedFs.shadow()); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + const file1Consumer2 = host.vfs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + const globalFile3 = host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + const moduleFile2 = host.vfs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + host.vfs.addFile(libFile.path, libFile.content); + + const session = createSession(host, createTestTypingsInstaller(host)); openFilesForSession([globalFile3], session); - const changeGlobalFile3ShapeRequest = makeSessionRequest(CommandNames.Change, { + + // check after file1 shape changes + sendChangeRequest(session, { file: globalFile3.path, line: 1, offset: 1, @@ -307,74 +346,62 @@ namespace ts.projectSystem { insertString: `var T2: string;` }); - // check after file1 shape changes - session.executeCommand(changeGlobalFile3ShapeRequest); - const globalFile3FileListRequest = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: globalFile3.path }); - sendAffectedFileRequestAndCheckResult(session, globalFile3FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2] }]); + sendAffectedFileRequestAndCheckResult(session, + { file: globalFile3.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2] }); }); it("should return empty array if CompileOnSave is not enabled", () => { - configFile = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - - const host = new mocks.MockServerHost(sharedFs.shadow()); - host.vfs.writeFile(configFile.path, configFile.content); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{}`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + host.vfs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + host.vfs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + host.vfs.addFile(libFile.path, libFile.content); + + const session = createSession(host, createTestTypingsInstaller(host)); + openFilesForSession([moduleFile1], session); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, []); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + []); }); it("should save when compileOnSave is enabled in base tsconfig.json", () => { - configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "extends": "/a/tsconfig.json" - }` - }; - - const configFile2: FileOrFolder = { - path: "/a/tsconfig.json", - content: `{ - "compileOnSave": true - }` - }; - - const host = new mocks.MockServerHost(sharedFs.shadow()); - host.vfs.writeFile(configFile.path, configFile.content); - host.vfs.addFile(configFile2.path, configFile2.content); - - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ "extends": "/a/tsconfig.json" }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + const file1Consumer2 = host.vfs.addFile("/a/b/file1Consumer2.ts", `import {Foo} from "./moduleFile1"; let z = 10;`); + host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); + host.vfs.addFile("/a/b/moduleFile2.ts", `export var Foo4 = 10;`); + host.vfs.addFile(libFile.path, libFile.content); + host.vfs.addFile("/a/tsconfig.json", `{ "compileOnSave": true }`); + + const session = createSession(host, createTestTypingsInstaller(host)); openFilesForSession([moduleFile1, file1Consumer1], session); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }); }); it("should always return the file itself if '--isolatedModules' is specified", () => { - configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compileOnSave": true, - "compilerOptions": { - "isolatedModules": true - } - }` - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(moduleFile1.path, moduleFile1.content); - host.vfs.addFile(file1Consumer1.path, file1Consumer1.content); - host.vfs.addFile(configFile.path, configFile.content); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ "compileOnSave": true, "compilerOptions": { "isolatedModules": true } }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); host.vfs.addFile(libFile.path, libFile.content); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const session = createSession(host, createTestTypingsInstaller(host)); + openFilesForSession([moduleFile1], session); - const file1ChangeShapeRequest = makeSessionRequest(CommandNames.Change, { + sendChangeRequest(session, { file: moduleFile1.path, line: 1, offset: 27, @@ -382,33 +409,24 @@ namespace ts.projectSystem { endOffset: 27, insertString: `Point,` }); - session.executeCommand(file1ChangeShapeRequest); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1] }]); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1] }); }); it("should always return the file itself if '--out' or '--outFile' is specified", () => { - configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compileOnSave": true, - "compilerOptions": { - "module": "system", - "outFile": "/a/b/out.js" - } - }` - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(moduleFile1.path, moduleFile1.content); - host.vfs.addFile(file1Consumer1.path, file1Consumer1.content); - host.vfs.addFile(configFile.path, configFile.content); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ "compileOnSave": true, "compilerOptions": { "module": "system", "outFile": "/a/b/out.js" } }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); host.vfs.addFile(libFile.path, libFile.content); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const session = createSession(host, createTestTypingsInstaller(host)); + openFilesForSession([moduleFile1], session); - const file1ChangeShapeRequest = makeSessionRequest(CommandNames.Change, { + sendChangeRequest(session, { file: moduleFile1.path, line: 1, offset: 27, @@ -416,32 +434,39 @@ namespace ts.projectSystem { endOffset: 27, insertString: `Point,` }); - session.executeCommand(file1ChangeShapeRequest); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1] }]); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1] }); }); it("should return cascaded affected file list", () => { - const file1Consumer1Consumer1: FileOrFolder = { - path: "/a/b/file1Consumer1Consumer1.ts", - content: `import {y} from "./file1Consumer1";` - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(moduleFile1.path, moduleFile1.content); - host.vfs.addFile(file1Consumer1.path, file1Consumer1.content); - host.vfs.addFile(file1Consumer1Consumer1.path, file1Consumer1Consumer1.content); - host.vfs.addFile(globalFile3.path, globalFile3.content); - host.vfs.addFile(configFile.path, configFile.content); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); + const file1Consumer1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1Consumer1.ts", `import {y} from "./file1Consumer1";`); + host.vfs.addFile("/a/b/globalFile3.ts", `interface GlobalFoo { age: number }`); host.vfs.addFile(libFile.path, libFile.content); - host.vfs.addFile(file1Consumer1Consumer1.path, file1Consumer1Consumer1.content); - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const session = createSession(host, createTestTypingsInstaller(host)); openFilesForSession([moduleFile1, file1Consumer1], session); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer1Consumer1] }]); - const changeFile1Consumer1ShapeRequest = makeSessionRequest(CommandNames.Change, { + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer1Consumer1] }); + + sendChangeRequest(session, { + file: moduleFile1.path, + line: 1, + offset: 1, + endLine: 1, + endOffset: 1, + insertString: `export var T: number;` + }); + + sendChangeRequest(session, { file: file1Consumer1.path, line: 2, offset: 1, @@ -449,75 +474,52 @@ namespace ts.projectSystem { endOffset: 1, insertString: `export var T: number;` }); - session.executeCommand(changeModuleFile1ShapeRequest1); - session.executeCommand(changeFile1Consumer1ShapeRequest); - sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer1Consumer1] }]); + + sendAffectedFileRequestAndCheckResult(session, + { projectFileName: configFile.path, file: moduleFile1.path }, + { projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer1Consumer1] }); }); it("should work fine for files with circular references", () => { - const file1: FileOrFolder = { - path: "/a/b/file1.ts", - content: ` - /// - export var t1 = 10;` - }; - const file2: FileOrFolder = { - path: "/a/b/file2.ts", - content: ` - /// - export var t2 = 10;` - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(file1.path, file1.content); - host.vfs.addFile(file2.path, file2.content); - host.vfs.addFile(configFile.path, configFile.content); - - const typingsInstaller = createTestTypingsInstaller(host); - const session = createSession(host, typingsInstaller); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const file1 = host.vfs.addFile("/a/b/file1.ts", `/// \nexport var t1 = 10;`); + const file2 = host.vfs.addFile("/a/b/file2.ts", `/// \nexport var t2 = 10;`); + + const session = createSession(host, createTestTypingsInstaller(host)); openFilesForSession([file1, file2], session); - const file1AffectedListRequest = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: file1.path }); - sendAffectedFileRequestAndCheckResult(session, file1AffectedListRequest, [{ projectFileName: configFile.path, files: [file1, file2] }]); + + sendAffectedFileRequestAndCheckResult(session, + { file: file1.path }, + { projectFileName: configFile.path, files: [file1, file2] }); }); it("should return results for all projects if not specifying projectFileName", () => { - const file1: FileOrFolder = { path: "/a/b/file1.ts", content: "export var t = 10;" }; - const file2: FileOrFolder = { path: "/a/b/file2.ts", content: `import {t} from "./file1"; var t2 = 11;` }; - const file3: FileOrFolder = { path: "/a/c/file2.ts", content: `import {t} from "../b/file1"; var t3 = 11;` }; - const configFile1: FileOrFolder = { path: "/a/b/tsconfig.json", content: `{ "compileOnSave": true }` }; - const configFile2: FileOrFolder = { path: "/a/c/tsconfig.json", content: `{ "compileOnSave": true }` }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(file1.path, file1.content); - host.vfs.addFile(file2.path, file2.content); - host.vfs.addFile(file3.path, file3.content); - host.vfs.addFile(configFile1.path, configFile1.content); - host.vfs.addFile(configFile2.path, configFile2.content); + const host = new mocks.MockServerHost(); + const file1 = host.vfs.addFile("/a/b/file1.ts", `export var t = 10;`); + const file2 = host.vfs.addFile("/a/b/file2.ts", `import {t} from "./file1"; var t2 = 11;`); + const file3 = host.vfs.addFile("/a/c/file2.ts", `import {t} from "../b/file1"; var t3 = 11;`); + const configFile1 = host.vfs.addFile("/a/b/tsconfig.json", `{ "compileOnSave": true }`); + const configFile2 = host.vfs.addFile("/a/c/tsconfig.json", `{ "compileOnSave": true }`); const session = createSession(host); openFilesForSession([file1, file2, file3], session); - const file1AffectedListRequest = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: file1.path }); - sendAffectedFileRequestAndCheckResult(session, file1AffectedListRequest, [ - { projectFileName: configFile1.path, files: [file1, file2] }, - { projectFileName: configFile2.path, files: [file1, file3] } - ]); + sendAffectedFileRequestAndCheckResult(session, + { file: file1.path }, + [ + { projectFileName: configFile1.path, files: [file1, file2] }, + { projectFileName: configFile2.path, files: [file1, file3] } + ]); }); it("should detect removed code file", () => { - const referenceFile1: FileOrFolder = { - path: "/a/b/referenceFile1.ts", - content: ` - /// - export var x = Foo();` - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(moduleFile1.path, moduleFile1.content); - host.vfs.addFile(referenceFile1.path, referenceFile1.content); - host.vfs.addFile(configFile.path, configFile.content); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); + const referenceFile1 = host.vfs.addFile("/a/b/referenceFile1.ts", `/// \nexport var x = Foo();`); const session = createSession(host); @@ -525,35 +527,27 @@ namespace ts.projectSystem { host.vfs.removeFile(moduleFile1.path); - const request = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: referenceFile1.path }); - sendAffectedFileRequestAndCheckResult(session, request, [ - { projectFileName: configFile.path, files: [referenceFile1] } - ]); + sendAffectedFileRequestAndCheckResult(session, + { file: referenceFile1.path }, + { projectFileName: configFile.path, files: [referenceFile1] }); - const requestForMissingFile = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: moduleFile1.path }); - sendAffectedFileRequestAndCheckResult(session, requestForMissingFile, []); + sendAffectedFileRequestAndCheckResult(session, + { file: moduleFile1.path }, + []); }); it("should detect non-existing code file", () => { - const referenceFile1: FileOrFolder = { - path: "/a/b/referenceFile1.ts", - content: ` - /// - export var x = Foo();` - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(referenceFile1.path, referenceFile1.content); - host.vfs.addFile(configFile.path, configFile.content); + const host = new mocks.MockServerHost(); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); + const referenceFile1 = host.vfs.addFile("/a/b/referenceFile1.ts", `/// \nexport var x = Foo();`); const session = createSession(host); openFilesForSession([referenceFile1], session); - const request = makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, { file: referenceFile1.path }); - sendAffectedFileRequestAndCheckResult(session, request, [ - { projectFileName: configFile.path, files: [referenceFile1] } - ]); + sendAffectedFileRequestAndCheckResult(session, + { file: referenceFile1.path }, + { projectFileName: configFile.path, files: [referenceFile1] }); }); }); }); @@ -563,63 +557,33 @@ namespace ts.projectSystem { test("\n"); test("\r\n"); - function test(newLine: string) { - const lines = ["var x = 1;", "var y = 2;"]; - const path = "/a/app"; - const f = { - path: path + ts.Extension.Ts, - content: lines.join(newLine) - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true), /*executingFilePath*/ undefined, newLine); - host.vfs.addFile(f.path, f.content); + function test(newLine: "\r\n" | "\n") { + const host = new mocks.MockServerHost({ newLine }); + const f = host.vfs.addFile("/a/app.ts", `var x = 1;${newLine}var y = 2;`); const session = createSession(host); - const openRequest: server.protocol.OpenRequest = { - seq: 1, - type: "request", - command: server.protocol.CommandTypes.Open, - arguments: { file: f.path } - }; - session.executeCommand(openRequest); - const emitFileRequest: server.protocol.CompileOnSaveEmitFileRequest = { - seq: 2, - type: "request", - command: server.protocol.CommandTypes.CompileOnSaveEmitFile, - arguments: { file: f.path } - }; - session.executeCommand(emitFileRequest); - const emitOutput = host.readFile(path + ts.Extension.Js); + + sendOpenRequest(session, { file: f.path }, 1); + sendCompileOnSaveEmitFileRequest(session, { file: f.path }, 2); + + const emitOutput = host.readFile("/a/app.js"); assert.equal(emitOutput, f.content + newLine, "content of emit output should be identical with the input + newline"); } }); it("should emit specified file", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export function Foo() { return 10; }` - }; - const file2 = { - path: "/a/b/f2.ts", - content: `import {Foo} from "./f1"; let y = Foo();` - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true), /*executingFilePath*/ undefined, "\r\n"); - host.vfs.addFile(file1.path, file1.content); - host.vfs.addFile(file2.path, file2.content); - host.vfs.addFile(configFile.path, configFile.content); + const host = new mocks.MockServerHost({ newLine: "\r\n" }); + const file1 = host.vfs.addFile("/a/b/f1.ts", `export function Foo() { return 10; }`); + const file2 = host.vfs.addFile("/a/b/f2.ts", `import {Foo} from "./f1"; let y = Foo();`); + const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{}`); host.vfs.addFile(libFile.path, libFile.content); const typingsInstaller = createTestTypingsInstaller(host); const session = createSession(host, { typingsInstaller }); openFilesForSession([file1, file2], session); - const compileFileRequest = makeSessionRequest(CommandNames.CompileOnSaveEmitFile, { file: file1.path, projectFileName: configFile.path }); - session.executeCommand(compileFileRequest); + + sendCompileOnSaveEmitFileRequest(session, { file: file1.path, projectFileName: configFile.path }); const expectedEmittedFileName = "/a/b/f1.js"; assert.isTrue(host.fileExists(expectedEmittedFileName)); @@ -627,25 +591,13 @@ namespace ts.projectSystem { }); it("shoud not emit js files in external projects", () => { - const file1 = { - path: "/a/b/file1.ts", - content: "consonle.log('file1');" - }; - // file2 has errors. The emitting should not be blocked. - const file2 = { - path: "/a/b/file2.js", - content: "console.log'file2');" - }; - const file3 = { - path: "/a/b/file3.js", - content: "console.log('file3');" - }; const externalProjectName = "/a/b/externalproject"; - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(file1.path, file1.content); - host.vfs.addFile(file2.path, file2.content); - host.vfs.addFile(file3.path, file3.content); + const host = new mocks.MockServerHost(); + const file1 = host.vfs.addFile("/a/b/file1.ts", `consonle.log('file1');`); + // file2 has errors. The emit should not be blocked. + const file2 = host.vfs.addFile("/a/b/file2.js", `console.log'file2');`); + const file3 = host.vfs.addFile("/a/b/file3.js", `console.log('file3');`); host.vfs.addFile(libFile.path, libFile.content); const session = createSession(host); @@ -661,8 +613,7 @@ namespace ts.projectSystem { projectFileName: externalProjectName }); - const emitRequest = makeSessionRequest(CommandNames.CompileOnSaveEmitFile, { file: file1.path }); - session.executeCommand(emitRequest); + sendCompileOnSaveEmitFileRequest(session, { file: file1.path }); const expectedOutFileName = "/a/b/dist.js"; assert.isTrue(host.fileExists(expectedOutFileName)); @@ -673,15 +624,10 @@ namespace ts.projectSystem { }); it("should use project root as current directory so that compile on save results in correct file mapping", () => { - const inputFileName = "Foo.ts"; - const file1 = { - path: `/root/TypeScriptProject3/TypeScriptProject3/${inputFileName}`, - content: "consonle.log('file1');" - }; const externalProjectName = "/root/TypeScriptProject3/TypeScriptProject3/TypeScriptProject3.csproj"; - const host = new mocks.MockServerHost(new vfs.VirtualFileSystem("/", /*useCaseSensitiveFileNames*/ true)); - host.vfs.addFile(file1.path, file1.content); + const host = new mocks.MockServerHost(); + const file1 = host.vfs.addFile("/root/TypeScriptProject3/TypeScriptProject3/Foo.ts", `consonle.log('file1');`); host.vfs.addFile(libFile.path, libFile.content); const session = createSession(host); @@ -698,8 +644,7 @@ namespace ts.projectSystem { projectFileName: externalProjectName }); - const emitRequest = makeSessionRequest(CommandNames.CompileOnSaveEmitFile, { file: file1.path }); - session.executeCommand(emitRequest); + sendCompileOnSaveEmitFileRequest(session, { file: file1.path }); // Verify js file const expectedOutFileName = "/root/TypeScriptProject3/TypeScriptProject3/" + outFileName; @@ -712,7 +657,7 @@ namespace ts.projectSystem { const expectedMapFileName = expectedOutFileName + ".map"; assert.isTrue(host.fileExists(expectedMapFileName)); const mapFileContent = host.readFile(expectedMapFileName); - verifyContentHasString(mapFileContent, `"sources":["${inputFileName}"]`); + verifyContentHasString(mapFileContent, `"sources":["Foo.ts"]`); function verifyContentHasString(content: string, str: string) { assert.isTrue(stringContains(content, str), `Expected "${content}" to have "${str}"`); diff --git a/src/harness/unittests/projectErrors.ts b/src/harness/unittests/projectErrors.ts index dae465a3ef333..7ea2af973d083 100644 --- a/src/harness/unittests/projectErrors.ts +++ b/src/harness/unittests/projectErrors.ts @@ -1,6 +1,7 @@ /// /// /// +/// namespace ts.projectSystem { describe("Project errors", () => { @@ -30,177 +31,127 @@ namespace ts.projectSystem { } it("external project - diagnostics for missing files", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; - const file2 = { - path: "/a/b/applib.ts", - content: "" - }; - const host = createServerHost([file1, libFile]); + const host = new mocks.MockServerHost({ safeList: true, lib: true }); + host.vfs.addFile("/a/b/app.ts", ``); + + const projectFileName = "/a/b/test.csproj"; + const session = createSession(host); const projectService = session.getProjectService(); - const projectFileName = "/a/b/test.csproj"; - const compilerOptionsRequest: server.protocol.CompilerOptionsDiagnosticsRequest = { - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 2, - arguments: { projectFileName } - }; - - { - projectService.openExternalProject({ - projectFileName, - options: {}, - rootFiles: toExternalFiles([file1.path, file2.path]) - }); + projectService.openExternalProject({ + projectFileName, + options: {}, + rootFiles: toExternalFiles(["/a/b/app.ts", "/a/b/applib.ts"]) + }); - checkNumberOfProjects(projectService, { externalProjects: 1 }); - const diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[]; - // only file1 exists - expect error - checkDiagnosticsWithLinePos(diags, ["File '/a/b/applib.ts' not found."]); - } - host.reloadFS([file2, libFile]); - { - // only file2 exists - expect error - checkNumberOfProjects(projectService, { externalProjects: 1 }); - const diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[]; - checkDiagnosticsWithLinePos(diags, ["File '/a/b/app.ts' not found."]); - } + // only file1 exists - expect error + checkNumberOfProjects(projectService, { externalProjects: 1 }); + const diags1 = sendCompilerOptionsDiagnosticsRequest(session, { projectFileName }, /*seq*/ 2); + checkDiagnosticsWithLinePos(diags1, ["File '/a/b/applib.ts' not found."]); - host.reloadFS([file1, file2, libFile]); - { - // both files exist - expect no errors - checkNumberOfProjects(projectService, { externalProjects: 1 }); - const diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[]; - checkDiagnosticsWithLinePos(diags, []); - } + host.vfs.removeFile("/a/b/app.ts"); + host.vfs.addFile("/a/b/applib.ts", ``); + + // only file2 exists - expect error + checkNumberOfProjects(projectService, { externalProjects: 1 }); + const diags2 = sendCompilerOptionsDiagnosticsRequest(session, { projectFileName }, /*seq*/ 2); + checkDiagnosticsWithLinePos(diags2, ["File '/a/b/app.ts' not found."]); + + host.vfs.addFile("/a/b/app.ts", ``); + + // both files exist - expect no errors + checkNumberOfProjects(projectService, { externalProjects: 1 }); + const diags3 = sendCompilerOptionsDiagnosticsRequest(session, { projectFileName }, /*seq*/ 2); + checkDiagnosticsWithLinePos(diags3, []); }); it("configured projects - diagnostics for missing files", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; - const file2 = { - path: "/a/b/applib.ts", - content: "" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ files: [file1, file2].map(f => getBaseFileName(f.path)) }) - }; - const host = createServerHost([file1, config, libFile]); + const host = new mocks.MockServerHost({ safeList: true, lib: true }); + host.vfs.addFile("/a/b/app.ts", ``); + host.vfs.addFile("/a/b/tsconfig.json", `{ "files": ["app.ts", "applib.ts"] }`); + const session = createSession(host); const projectService = session.getProjectService(); - openFilesForSession([file1], session); + + openFilesForSession(["/a/b/app.ts"], session); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); const project = configuredProjectAt(projectService, 0); - const compilerOptionsRequest: server.protocol.CompilerOptionsDiagnosticsRequest = { - type: "request", - command: server.CommandNames.CompilerOptionsDiagnosticsFull, - seq: 2, - arguments: { projectFileName: project.getProjectName() } - }; - let diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[]; - checkDiagnosticsWithLinePos(diags, ["File '/a/b/applib.ts' not found."]); + const diags1 = sendCompilerOptionsDiagnosticsRequest(session, { projectFileName: project.getProjectName() }, /*seq*/ 2); + checkDiagnosticsWithLinePos(diags1, ["File '/a/b/applib.ts' not found."]); - host.reloadFS([file1, file2, config, libFile]); + host.vfs.addFile("/a/b/applib.ts", ``); checkNumberOfProjects(projectService, { configuredProjects: 1 }); - diags = session.executeCommand(compilerOptionsRequest).response as server.protocol.DiagnosticWithLinePosition[]; - checkDiagnosticsWithLinePos(diags, []); + const diags2 = sendCompilerOptionsDiagnosticsRequest(session, { projectFileName: project.getProjectName() }, /*seq*/ 2); + checkDiagnosticsWithLinePos(diags2, []); }); it("configured projects - diagnostics for corrupted config 1", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; - const file2 = { - path: "/a/b/lib.ts", - content: "" - }; - const correctConfig = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ files: [file1, file2].map(f => getBaseFileName(f.path)) }) - }; - const corruptedConfig = { - path: correctConfig.path, - content: correctConfig.content.substr(1) - }; - const host = createServerHost([file1, file2, corruptedConfig]); + const host = new mocks.MockServerHost({ safeList: true }); + host.vfs.addFile("/a/b/app.ts", ``); + host.vfs.addFile("/a/b/lib.ts", ``); + host.vfs.addFile("/a/b/tsconfig.json", ` "files": ["app.ts", "lib.ts"] }`); + const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - { - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - const configuredProject = forEach(projectService.synchronizeProjectList([]), f => f.info.projectName === corruptedConfig.path && f); - assert.isTrue(configuredProject !== undefined, "should find configured project"); - checkProjectErrors(configuredProject, []); - const projectErrors = configuredProjectAt(projectService, 0).getAllProjectErrors(); - checkProjectErrorsWorker(projectErrors, [ - "'{' expected." - ]); - assert.isNotNull(projectErrors[0].file); - assert.equal(projectErrors[0].file.fileName, corruptedConfig.path); - } + projectService.openClientFile("/a/b/app.ts"); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + + const configuredProject1 = find(projectService.synchronizeProjectList([]), f => f.info.projectName === "/a/b/tsconfig.json"); + assert.isTrue(configuredProject1 !== undefined, "should find configured project"); + checkProjectErrors(configuredProject1, []); + + const projectErrors1 = configuredProjectAt(projectService, 0).getAllProjectErrors(); + checkProjectErrorsWorker(projectErrors1, ["'{' expected."]); + assert.isNotNull(projectErrors1[0].file); + assert.equal(projectErrors1[0].file.fileName, "/a/b/tsconfig.json"); + // fix config and trigger watcher - host.reloadFS([file1, file2, correctConfig]); - { - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - const configuredProject = forEach(projectService.synchronizeProjectList([]), f => f.info.projectName === corruptedConfig.path && f); - assert.isTrue(configuredProject !== undefined, "should find configured project"); - checkProjectErrors(configuredProject, []); - const projectErrors = configuredProjectAt(projectService, 0).getAllProjectErrors(); - checkProjectErrorsWorker(projectErrors, []); - } + host.vfs.writeFile("/a/b/tsconfig.json", `{ "files": ["app.ts", "lib.ts"] }`); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + + const configuredProject2 = find(projectService.synchronizeProjectList([]), f => f.info.projectName === "/a/b/tsconfig.json"); + assert.isTrue(configuredProject2 !== undefined, "should find configured project"); + checkProjectErrors(configuredProject2, []); + + const projectErrors2 = configuredProjectAt(projectService, 0).getAllProjectErrors(); + checkProjectErrorsWorker(projectErrors2, []); }); it("configured projects - diagnostics for corrupted config 2", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; - const file2 = { - path: "/a/b/lib.ts", - content: "" - }; - const correctConfig = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ files: [file1, file2].map(f => getBaseFileName(f.path)) }) - }; - const corruptedConfig = { - path: correctConfig.path, - content: correctConfig.content.substr(1) - }; - const host = createServerHost([file1, file2, correctConfig]); + const host = new mocks.MockServerHost({ safeList: true }); + host.vfs.addFile("/a/b/app.ts", ``); + host.vfs.addFile("/a/b/lib.ts", ``); + host.vfs.addFile("/a/b/tsconfig.json", `{ "files": ["app.ts", "lib.ts"] }`); + const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - { - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - const configuredProject = forEach(projectService.synchronizeProjectList([]), f => f.info.projectName === corruptedConfig.path && f); - assert.isTrue(configuredProject !== undefined, "should find configured project"); - checkProjectErrors(configuredProject, []); - const projectErrors = configuredProjectAt(projectService, 0).getAllProjectErrors(); - checkProjectErrorsWorker(projectErrors, []); - } + projectService.openClientFile("/a/b/app.ts"); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + const configuredProject1 = find(projectService.synchronizeProjectList([]), f => f.info.projectName === "/a/b/tsconfig.json"); + assert.isTrue(configuredProject1 !== undefined, "should find configured project"); + checkProjectErrors(configuredProject1, []); + + const projectErrors1 = configuredProjectAt(projectService, 0).getAllProjectErrors(); + checkProjectErrorsWorker(projectErrors1, []); + // break config and trigger watcher - host.reloadFS([file1, file2, corruptedConfig]); - { - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - const configuredProject = forEach(projectService.synchronizeProjectList([]), f => f.info.projectName === corruptedConfig.path && f); - assert.isTrue(configuredProject !== undefined, "should find configured project"); - checkProjectErrors(configuredProject, []); - const projectErrors = configuredProjectAt(projectService, 0).getAllProjectErrors(); - checkProjectErrorsWorker(projectErrors, [ - "'{' expected." - ]); - assert.isNotNull(projectErrors[0].file); - assert.equal(projectErrors[0].file.fileName, corruptedConfig.path); - } + host.vfs.writeFile("/a/b/tsconfig.json", ` "files": ["app.ts", "lib.ts"] }`); + + projectService.checkNumberOfProjects({ configuredProjects: 1 }); + + const configuredProject2 = find(projectService.synchronizeProjectList([]), f => f.info.projectName === "/a/b/tsconfig.json"); + assert.isTrue(configuredProject2 !== undefined, "should find configured project"); + checkProjectErrors(configuredProject2, []); + + const projectErrors2 = configuredProjectAt(projectService, 0).getAllProjectErrors(); + checkProjectErrorsWorker(projectErrors2, ["'{' expected."]); + assert.isNotNull(projectErrors2[0].file); + assert.equal(projectErrors2[0].file.fileName, "/a/b/tsconfig.json"); }); }); } diff --git a/src/harness/unittests/reuseProgramStructure.ts b/src/harness/unittests/reuseProgramStructure.ts index 7e61f188b10c0..83bf2217db58e 100644 --- a/src/harness/unittests/reuseProgramStructure.ts +++ b/src/harness/unittests/reuseProgramStructure.ts @@ -915,7 +915,7 @@ namespace ts { } function verifyProgram(vfs: vfs.VirtualFileSystem, rootFiles: string[], options: CompilerOptions, configFile: string) { - const watchingSystemHost = createWatchingSystemHost(new mocks.MockServerHost(vfs)); + const watchingSystemHost = createWatchingSystemHost(new mocks.MockServerHost({ vfs })); verifyProgramWithoutConfigFile(watchingSystemHost, rootFiles, options); verifyProgramWithConfigFile(watchingSystemHost, configFile); } @@ -997,7 +997,7 @@ namespace ts { `export default classD;`); const configFile = fs.addFile("/src/tsconfig.json", JSON.stringify({ compilerOptions, include: ["packages/**/ *.ts"] })); - const watchingSystemHost = createWatchingSystemHost(new mocks.MockServerHost(fs)); + const watchingSystemHost = createWatchingSystemHost(new mocks.MockServerHost({ vfs: fs })); verifyProgramWithConfigFile(watchingSystemHost, configFile.path); }); }); diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index e173df04abc3a..22ec81d583e50 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -1,14 +1,16 @@ /// /// /// +/// +/// namespace ts.tscWatch { + import theory = utils.theory; + import Spy = typemock.Spy; + import Arg = typemock.Arg; + import Times = typemock.Times; - 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; @@ -41,46 +43,27 @@ namespace ts.tscWatch { return ts.createWatchModeWithoutConfigFile(fileNames, options, watchingSystemHost); } - function getEmittedLineForMultiFileOutput(file: FileOrFolder, host: ts.System) { - return `TSFILE: ${file.path.replace(".ts", ".js")}${host.newLine}`; + function formatOutputFile(path: string, host: ts.System) { + return `TSFILE: ${path}${host.newLine}`; } - function getEmittedLineForSingleFileOutput(filename: string, host: ts.System) { - return `TSFILE: ${filename}${host.newLine}`; - } - - interface FileOrFolderEmit extends FileOrFolder { - output?: string; - } - - function getFileOrFolderEmit(file: FileOrFolder, getOutput?: (file: FileOrFolder) => string): FileOrFolderEmit { - const result = file as FileOrFolderEmit; - if (getOutput) { - result.output = getOutput(file); - } - return result; - } - - function getEmittedLines(files: FileOrFolderEmit[]) { - const seen = createMap(); - const result: string[] = []; - for (const { output } of files) { - if (output && !seen.has(output)) { - seen.set(output, true); - result.push(output); + function getEmittedLines(files: ReadonlyArray, host: ts.System, getOutput: (file: string, host: ts.System) => string) { + let result: string[] | undefined; + if (files) { + const seen = createMap(); + result = []; + for (const file of files) { + const output = getOutput(file, host); + if (output && !seen.has(output)) { + seen.set(output, true); + result.push(output); + } } } return result; } - function checkAffectedLines(host: WatchedSystem, affectedFiles: FileOrFolderEmit[], allEmittedFiles: string[]) { - const expectedAffectedFiles = getEmittedLines(affectedFiles); - const expectedNonAffectedFiles = mapDefined(allEmittedFiles, line => contains(expectedAffectedFiles, line) ? undefined : line); - checkOutputContains(host, expectedAffectedFiles); - checkOutputDoesNotContain(host, expectedNonAffectedFiles); - } - - function checkOutputErrors(host: WatchedSystem, errors: ReadonlyArray, isInitial?: true, skipWaiting?: true) { + function checkOutputErrors(host: mocks.MockServerHost, errors: ReadonlyArray, isInitial?: true, skipWaiting?: true) { const outputs = host.getOutput(); const expectedOutputCount = (isInitial ? 0 : 1) + errors.length + (skipWaiting ? 0 : 1); assert.equal(outputs.length, expectedOutputCount, "Outputs = " + outputs.toString()); @@ -99,1832 +82,1297 @@ namespace ts.tscWatch { host.clearOutput(); } - function assertDiagnosticAt(host: WatchedSystem, outputAt: number, diagnostic: Diagnostic) { + function assertDiagnosticAt(host: mocks.MockServerHost, outputAt: number, diagnostic: Diagnostic) { const output = host.getOutput()[outputAt]; assert.equal(output, formatDiagnostic(diagnostic, host), "outputs[" + outputAt + "] is " + output); } - function assertWatchDiagnosticAt(host: WatchedSystem, outputAt: number, diagnosticMessage: DiagnosticMessage) { + function assertWatchDiagnosticAt(host: mocks.MockServerHost, outputAt: number, diagnosticMessage: DiagnosticMessage) { const output = host.getOutput()[outputAt]; assert.isTrue(endsWith(output, getWatchDiagnosticWithoutDate(host, diagnosticMessage)), "outputs[" + outputAt + "] is " + output); } - function getWatchDiagnosticWithoutDate(host: WatchedSystem, diagnosticMessage: DiagnosticMessage) { + function getWatchDiagnosticWithoutDate(host: mocks.MockServerHost, diagnosticMessage: DiagnosticMessage) { return ` - ${flattenDiagnosticMessageText(getLocaleSpecificMessage(diagnosticMessage), host.newLine)}${host.newLine + host.newLine + host.newLine}`; } - function getDiagnosticOfFileFrom(file: SourceFile, text: string, start: number, length: number, message: DiagnosticMessage): Diagnostic { + function getFile(program: Program, filePath: string) { + return program.getSourceFileByPath(toPath(filePath, program.getCurrentDirectory(), s => s.toLowerCase())); + } + + function getConfigFile(program: Program) { + return program.getCompilerOptions().configFile; + } + + function createDiagnostic(file: SourceFile | undefined, start: number | undefined, length: number | undefined, message: DiagnosticMessage, ...args: string[]): Diagnostic { + let text = getLocaleSpecificMessage(message); + if (args.length > 0) { + text = formatStringFromArgs(text, args); + } return { file, start, length, - messageText: text, category: message.category, code: message.code, }; } - function getDiagnosticWithoutFile(message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - let text = getLocaleSpecificMessage(message); + function createCompilerDiagnostic(message: DiagnosticMessage, ...args: string[]): Diagnostic { + return createDiagnostic(/*file*/ undefined, /*start*/ undefined, /*length*/ undefined, message, ...args); + } - if (arguments.length > 1) { - text = formatStringFromArgs(text, arguments, 1); - } + function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: string[]): Diagnostic { + return createDiagnostic(file, start, length, message, ...args); + } - return getDiagnosticOfFileFrom(/*file*/ undefined, text, /*start*/ undefined, /*length*/ undefined, message); + function createUnknownCompilerOptionDiagnostic(program: Program, content: string, option: string) { + const quotedOption = `"${option}"`; + return createFileDiagnostic(getConfigFile(program), content.indexOf(quotedOption), quotedOption.length, Diagnostics.Unknown_compiler_option_0, option); } - function getDiagnosticOfFile(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - let text = getLocaleSpecificMessage(message); + function createExclusiveCompilerOptionDiagnostic(program: Program, content: string, option1: string, option2: string, checkFirst: boolean) { + const quotedOption1 = `"${checkFirst ? option1 : option2 }"`; + return createFileDiagnostic(getConfigFile(program), content.indexOf(quotedOption1), quotedOption1.length, Diagnostics.Option_0_cannot_be_specified_with_option_1, option1, option2); + } - if (arguments.length > 4) { - text = formatStringFromArgs(text, arguments, 4); - } + function createCannotFindModuleDiagnostic(program: Program, path: string, content: string, moduleName: string) { + const quotedModuleName = `"${moduleName}"`; + return createFileDiagnostic(getFile(program, path), content.indexOf(quotedModuleName), quotedModuleName.length, Diagnostics.Cannot_find_module_0, moduleName); + } - return getDiagnosticOfFileFrom(file, text, start, length, message); + function createFileIsNotAModuleDiagnostic(program: Program, path: string, content: string, moduleName: string, modulePath: string) { + const quotedModuleName = `"${moduleName}"`; + return createFileDiagnostic(getFile(program, path), content.indexOf(quotedModuleName), quotedModuleName.length, Diagnostics.File_0_is_not_a_module, modulePath); } - function getUnknownCompilerOption(program: Program, configFile: FileOrFolder, option: string) { - const quotedOption = `"${option}"`; - return getDiagnosticOfFile(program.getCompilerOptions().configFile, configFile.content.indexOf(quotedOption), quotedOption.length, Diagnostics.Unknown_compiler_option_0, option); + function createFileNotFoundDiagnostic(program: Program, path: string, content: string, fragment: string, file: string) { + return createFileDiagnostic(getFile(program, path), content.indexOf(fragment), fragment.length, Diagnostics.File_0_not_found, file); } - function getDiagnosticOfFileFromProgram(program: Program, filePath: string, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { - let text = getLocaleSpecificMessage(message); + function createCannotFindNameDiagnostic(program: Program, path: string, content: string, name: string) { + return createFileDiagnostic(getFile(program, path), content.indexOf(name), name.length, Diagnostics.Cannot_find_name_0, name); + } - if (arguments.length > 5) { - text = formatStringFromArgs(text, arguments, 5); - } + describe("tsc-watch", () => { - return getDiagnosticOfFileFrom(program.getSourceFileByPath(toPath(filePath, program.getCurrentDirectory(), s => s.toLowerCase())), - text, start, length, message); - } + describe("program updates", () => { + it("create watch without config file", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/c/app.ts", `import {f} from "./module"\nconsole.log(f)`); + host.vfs.addFile("/a/b/c/module.d.ts", `export let x: number`); - function getDiagnosticModuleNotFoundOfFile(program: Program, file: FileOrFolder, moduleName: string) { - const quotedModuleName = `"${moduleName}"`; - return getDiagnosticOfFileFromProgram(program, file.path, file.content.indexOf(quotedModuleName), quotedModuleName.length, Diagnostics.Cannot_find_module_0, moduleName); - } + const watch = createWatchModeWithoutConfigFile(["/a/b/c/app.ts"], host); + checkProgramActualFiles(watch(), ["/a/b/c/app.ts", mocks.MockServerHost.libPath, "/a/b/c/module.d.ts"]); - describe("tsc-watch program updates", () => { - const commonFile1: FileOrFolder = { - path: "/a/b/commonFile1.ts", - content: "let x = 1" - }; - const commonFile2: FileOrFolder = { - path: "/a/b/commonFile2.ts", - content: "let y = 1" - }; + // TODO: Should we watch creation of config files in the root file's file hierarchy? - it("create watch without config file", () => { - const appFile: FileOrFolder = { - path: "/a/b/c/app.ts", - content: ` - import {f} from "./module" - console.log(f) - ` - }; - - const moduleFile: FileOrFolder = { - path: "/a/b/c/module.d.ts", - content: `export let x: number` - }; - const host = createWatchedSystem([appFile, moduleFile, libFile]); - const watch = createWatchModeWithoutConfigFile([appFile.path], host); - - checkProgramActualFiles(watch(), [appFile.path, libFile.path, moduleFile.path]); - - // TODO: Should we watch creation of config files in the root file's file hierarchy? - - // const configFileLocations = ["/a/b/c/", "/a/b/", "/a/", "/"]; - // const configFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]); - // checkWatchedFiles(host, configFiles.concat(libFile.path, moduleFile.path)); - }); + // const configFileLocations = ["/a/b/c/", "/a/b/", "/a/", "/"]; + // const configFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]); + // checkWatchedFiles(host, configFiles.concat(mocks.MockServerHost.libPath, "/a/b/c/module.d.ts")); + }); - it("can handle tsconfig file name with difference casing", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ - include: ["app.ts"] - }) - }; - - const host = createWatchedSystem([f1, config], { useCaseSensitiveFileNames: false }); - const upperCaseConfigFilePath = combinePaths(getDirectoryPath(config.path).toUpperCase(), getBaseFileName(config.path)); - const watch = createWatchModeWithConfigFile(upperCaseConfigFilePath, host); - checkProgramActualFiles(watch(), [combinePaths(getDirectoryPath(upperCaseConfigFilePath), getBaseFileName(f1.path))]); - }); + it("can handle tsconfig file name with difference casing", () => { + const host = new mocks.MockServerHost({ vfs: { useCaseSensitiveFileNames: false } }); + host.vfs.addFile("/a/b/app.ts", `let x = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "include": ["app.ts"] }`); - it("create configured project without file list", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: ` - { - "compilerOptions": {}, - "exclude": [ - "e" - ] - }` - }; - const file1: FileOrFolder = { - path: "/a/b/c/f1.ts", - content: "let x = 1" - }; - const file2: FileOrFolder = { - path: "/a/b/d/f2.ts", - content: "let y = 1" - }; - const file3: FileOrFolder = { - path: "/a/b/e/f3.ts", - content: "let z = 1" - }; - - const host = createWatchedSystem([configFile, libFile, file1, file2, file3]); - const watchingSystemHost = createWatchingSystemHost(host); - const configFileResult = parseConfigFile(configFile.path, watchingSystemHost); - assert.equal(configFileResult.errors.length, 0, `expect no errors in config file, got ${JSON.stringify(configFileResult.errors)}`); - - const watch = ts.createWatchModeWithConfigFile(configFileResult, {}, watchingSystemHost); - - checkProgramActualFiles(watch(), [file1.path, libFile.path, file2.path]); - checkProgramRootFiles(watch(), [file1.path, file2.path]); - checkWatchedFiles(host, [configFile.path, file1.path, file2.path, libFile.path]); - const configDir = getDirectoryPath(configFile.path); - checkWatchedDirectories(host, [configDir, combinePaths(configDir, projectSystem.nodeModulesAtTypes)], /*recursive*/ true); - }); + const watch = createWatchModeWithConfigFile("/A/B/tsconfig.json", host); + checkProgramActualFiles(watch(), ["/A/B/app.ts"]); + }); - // TODO: if watching for config file creation - // it("add and then remove a config file in a folder with loose files", () => { - // }); - - it("add new files to a configured program without file list", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - const host = createWatchedSystem([commonFile1, libFile, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - const configDir = getDirectoryPath(configFile.path); - checkWatchedDirectories(host, [configDir, combinePaths(configDir, projectSystem.nodeModulesAtTypes)], /*recursive*/ true); - - checkProgramRootFiles(watch(), [commonFile1.path]); - - // add a new ts file - host.reloadFS([commonFile1, commonFile2, libFile, configFile]); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramRootFiles(watch(), [commonFile1.path, commonFile2.path]); - }); + it("create configured project without file list", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "exclude": ["e"] }`); + host.vfs.addFile("/a/b/c/f1.ts", `let x = 1`); + host.vfs.addFile("/a/b/d/f2.ts", `let y = 1`); + host.vfs.addFile("/a/b/e/f3.ts", `let z = 1`); - it("should ignore non-existing files specified in the config file", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {}, - "files": [ - "commonFile1.ts", - "commonFile3.ts" - ] - }` - }; - const host = createWatchedSystem([commonFile1, commonFile2, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - - const commonFile3 = "/a/b/commonFile3.ts"; - checkProgramRootFiles(watch(), [commonFile1.path, commonFile3]); - checkProgramActualFiles(watch(), [commonFile1.path]); - }); + const watchingSystemHost = createWatchingSystemHost(host); + const configFileResult = parseConfigFile("/a/b/tsconfig.json", watchingSystemHost); + assert.equal(configFileResult.errors.length, 0, `expect no errors in config file, got ${JSON.stringify(configFileResult.errors)}`); - it("handle recreated files correctly", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - const host = createWatchedSystem([commonFile1, commonFile2, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkProgramRootFiles(watch(), [commonFile1.path, commonFile2.path]); - - // delete commonFile2 - host.reloadFS([commonFile1, configFile]); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramRootFiles(watch(), [commonFile1.path]); - - // re-add commonFile2 - host.reloadFS([commonFile1, commonFile2, configFile]); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramRootFiles(watch(), [commonFile1.path, commonFile2.path]); - }); + const watch = ts.createWatchModeWithConfigFile(configFileResult, {}, watchingSystemHost); - it("handles the missing files - that were added to program because they were added with /// { - const commonFile2Name = "commonFile2.ts"; - const file1: FileOrFolder = { - path: "/a/b/commonFile1.ts", - content: `/// - let x = y` - }; - const host = createWatchedSystem([file1, libFile]); - const watch = createWatchModeWithoutConfigFile([file1.path], host); - - checkProgramRootFiles(watch(), [file1.path]); - checkProgramActualFiles(watch(), [file1.path, libFile.path]); - checkOutputErrors(host, [ - getDiagnosticOfFileFromProgram(watch(), file1.path, file1.content.indexOf(commonFile2Name), commonFile2Name.length, Diagnostics.File_0_not_found, commonFile2.path), - getDiagnosticOfFileFromProgram(watch(), file1.path, file1.content.indexOf("y"), 1, Diagnostics.Cannot_find_name_0, "y") - ], /*isInitial*/ true); - - host.reloadFS([file1, commonFile2, libFile]); - host.runQueuedTimeoutCallbacks(); - checkProgramRootFiles(watch(), [file1.path]); - checkProgramActualFiles(watch(), [file1.path, libFile.path, commonFile2.path]); - checkOutputErrors(host, emptyArray); - }); + checkProgramActualFiles(watch(), ["/a/b/c/f1.ts", mocks.MockServerHost.libPath, "/a/b/d/f2.ts"]); + checkProgramRootFiles(watch(), ["/a/b/c/f1.ts", "/a/b/d/f2.ts"]); + checkWatchedFiles(host, ["/a/b/tsconfig.json", "/a/b/c/f1.ts", "/a/b/d/f2.ts", mocks.MockServerHost.libPath]); + checkWatchedDirectories(host, ["/a/b", "/a/b/node_modules/@types"], /*recursive*/ true); + }); - it("should reflect change in config file", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {}, - "files": ["${commonFile1.path}", "${commonFile2.path}"] - }` - }; - const files = [commonFile1, commonFile2, configFile]; - const host = createWatchedSystem(files); - const watch = createWatchModeWithConfigFile(configFile.path, host); - - checkProgramRootFiles(watch(), [commonFile1.path, commonFile2.path]); - configFile.content = `{ - "compilerOptions": {}, - "files": ["${commonFile1.path}"] - }`; - - host.reloadFS(files); - host.checkTimeoutQueueLengthAndRun(1); // reload the configured project - checkProgramRootFiles(watch(), [commonFile1.path]); - }); + // TODO: if watching for config file creation + // it("add and then remove a config file in a folder with loose files", () => { + // }); - it("files explicitly excluded in config file", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {}, - "exclude": ["/a/c"] - }` - }; - const excludedFile1: FileOrFolder = { - path: "/a/c/excluedFile1.ts", - content: `let t = 1;` - }; - - const host = createWatchedSystem([commonFile1, commonFile2, excludedFile1, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkProgramRootFiles(watch(), [commonFile1.path, commonFile2.path]); - }); + it("add new files to a configured program without file list", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{}`); - it("should properly handle module resolution changes in config file", () => { - const file1: FileOrFolder = { - path: "/a/b/file1.ts", - content: `import { T } from "module1";` - }; - const nodeModuleFile: FileOrFolder = { - path: "/a/b/node_modules/module1.ts", - content: `export interface T {}` - }; - const classicModuleFile: FileOrFolder = { - path: "/a/module1.ts", - content: `export interface T {}` - }; - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "moduleResolution": "node" - }, - "files": ["${file1.path}"] - }` - }; - const files = [file1, nodeModuleFile, classicModuleFile, configFile]; - const host = createWatchedSystem(files); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkProgramRootFiles(watch(), [file1.path]); - checkProgramActualFiles(watch(), [file1.path, nodeModuleFile.path]); - - configFile.content = `{ - "compilerOptions": { - "moduleResolution": "classic" - }, - "files": ["${file1.path}"] - }`; - host.reloadFS(files); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramRootFiles(watch(), [file1.path]); - checkProgramActualFiles(watch(), [file1.path, classicModuleFile.path]); - }); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkWatchedDirectories(host, ["/a/b", "/a/b/node_modules/@types"], /*recursive*/ true); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts"]); - it("should tolerate config file errors and still try to build a project", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "target": "es6", - "allowAnything": true - }, - "someOtherProperty": {} - }` - }; - const host = createWatchedSystem([commonFile1, commonFile2, libFile, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkProgramRootFiles(watch(), [commonFile1.path, commonFile2.path]); - }); + // add a new ts file + host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); - it("changes in files are reflected in project structure", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export * from "./f2"` - }; - const file2 = { - path: "/a/b/f2.ts", - content: `export let x = 1` - }; - const file3 = { - path: "/a/c/f3.ts", - content: `export let y = 1;` - }; - const host = createWatchedSystem([file1, file2, file3]); - const watch = createWatchModeWithoutConfigFile([file1.path], host); - checkProgramRootFiles(watch(), [file1.path]); - checkProgramActualFiles(watch(), [file1.path, file2.path]); - - const modifiedFile2 = { - path: file2.path, - content: `export * from "../c/f3"` // now inferred project should inclule file3 - }; - - host.reloadFS([file1, modifiedFile2, file3]); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramRootFiles(watch(), [file1.path]); - checkProgramActualFiles(watch(), [file1.path, modifiedFile2.path, file3.path]); - }); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"]); + }); - it("deleted files affect project structure", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export * from "./f2"` - }; - const file2 = { - path: "/a/b/f2.ts", - content: `export * from "../c/f3"` - }; - const file3 = { - path: "/a/c/f3.ts", - content: `export let y = 1;` - }; - const host = createWatchedSystem([file1, file2, file3]); - const watch = createWatchModeWithoutConfigFile([file1.path], host); - checkProgramActualFiles(watch(), [file1.path, file2.path, file3.path]); - - host.reloadFS([file1, file3]); - host.checkTimeoutQueueLengthAndRun(1); - - checkProgramActualFiles(watch(), [file1.path]); - }); + it("should ignore non-existing files specified in the config file", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); + host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["commonFile1.ts", "commonFile3.ts"] }`); - it("deleted files affect project structure - 2", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export * from "./f2"` - }; - const file2 = { - path: "/a/b/f2.ts", - content: `export * from "../c/f3"` - }; - const file3 = { - path: "/a/c/f3.ts", - content: `export let y = 1;` - }; - const host = createWatchedSystem([file1, file2, file3]); - const watch = createWatchModeWithoutConfigFile([file1.path, file3.path], host); - checkProgramActualFiles(watch(), [file1.path, file2.path, file3.path]); - - host.reloadFS([file1, file3]); - host.checkTimeoutQueueLengthAndRun(1); - - checkProgramActualFiles(watch(), [file1.path, file3.path]); - }); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts", "/a/b/commonFile3.ts"]); + checkProgramActualFiles(watch(), ["/a/b/commonFile1.ts"]); + }); - it("config file includes the file", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "export let x = 5" - }; - const file2 = { - path: "/a/c/f2.ts", - content: `import {x} from "../b/f1"` - }; - const file3 = { - path: "/a/c/f3.ts", - content: "export let y = 1" - }; - const configFile = { - path: "/a/c/tsconfig.json", - content: JSON.stringify({ compilerOptions: {}, files: ["f2.ts", "f3.ts"] }) - }; - - const host = createWatchedSystem([file1, file2, file3, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - - checkProgramRootFiles(watch(), [file2.path, file3.path]); - checkProgramActualFiles(watch(), [file1.path, file2.path, file3.path]); - }); + it("handle recreated files correctly", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); + host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{}`); - it("correctly migrate files between projects", () => { - const file1 = { - path: "/a/b/f1.ts", - content: ` - export * from "../c/f2"; - export * from "../d/f3";` - }; - const file2 = { - path: "/a/c/f2.ts", - content: "export let x = 1;" - }; - const file3 = { - path: "/a/d/f3.ts", - content: "export let y = 1;" - }; - const host = createWatchedSystem([file1, file2, file3]); - const watch = createWatchModeWithoutConfigFile([file2.path, file3.path], host); - checkProgramActualFiles(watch(), [file2.path, file3.path]); - - const watch2 = createWatchModeWithoutConfigFile([file1.path], host); - checkProgramActualFiles(watch2(), [file1.path, file2.path, file3.path]); - - // Previous program shouldnt be updated - checkProgramActualFiles(watch(), [file2.path, file3.path]); - host.checkTimeoutQueueLength(0); - }); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"]); - it("can correctly update configured project when set of root files has changed (new file on disk)", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 1" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {} }) - }; - - const host = createWatchedSystem([file1, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkProgramActualFiles(watch(), [file1.path]); - - host.reloadFS([file1, file2, configFile]); - host.checkTimeoutQueueLengthAndRun(1); - - checkProgramActualFiles(watch(), [file1.path, file2.path]); - checkProgramRootFiles(watch(), [file1.path, file2.path]); - }); + // delete commonFile2 + host.vfs.removeFile("/a/b/commonFile2.ts"); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts"]); - it("can correctly update configured project when set of root files has changed (new file in list of files)", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 1" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts"] }) - }; - - const host = createWatchedSystem([file1, file2, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - - checkProgramActualFiles(watch(), [file1.path]); - - const modifiedConfigFile = { - path: configFile.path, - content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] }) - }; - - host.reloadFS([file1, file2, modifiedConfigFile]); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramRootFiles(watch(), [file1.path, file2.path]); - checkProgramActualFiles(watch(), [file1.path, file2.path]); - }); + // re-add commonFile2 + host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"]); + }); - it("can update configured project when set of root files was not changed", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 1" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] }) - }; - - const host = createWatchedSystem([file1, file2, configFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkProgramActualFiles(watch(), [file1.path, file2.path]); - - const modifiedConfigFile = { - path: configFile.path, - content: JSON.stringify({ compilerOptions: { outFile: "out.js" }, files: ["f1.ts", "f2.ts"] }) - }; - - host.reloadFS([file1, file2, modifiedConfigFile]); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramRootFiles(watch(), [file1.path, file2.path]); - checkProgramActualFiles(watch(), [file1.path, file2.path]); - }); + it("handles the missing files - that were added to program because they were added with /// { + const file1Content = `/// \nlet x = y`; - it("config file is deleted", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1;" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 2;" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {} }) - }; - const host = createWatchedSystem([file1, file2, libFile, config]); - const watch = createWatchModeWithConfigFile(config.path, host); - - checkProgramActualFiles(watch(), [file1.path, file2.path, libFile.path]); - checkOutputErrors(host, emptyArray, /*isInitial*/ true); - - host.reloadFS([file1, file2, libFile]); - host.checkTimeoutQueueLengthAndRun(1); - - assert.equal(host.exitCode, ExitStatus.DiagnosticsPresent_OutputsSkipped); - checkOutputErrors(host, [ - getDiagnosticWithoutFile(Diagnostics.File_0_not_found, config.path) - ], /*isInitial*/ undefined, /*skipWaiting*/ true); - }); + const host = new mocks.MockServerHost({ lib: true, vfs: { useCaseSensitiveFileNames: false } }); + host.vfs.addFile("/a/b/commonFile1.ts", file1Content); - it("Proper errors: document is not contained in project", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; - const corruptedConfig = { - path: "/a/b/tsconfig.json", - content: "{" - }; - const host = createWatchedSystem([file1, corruptedConfig]); - const watch = createWatchModeWithConfigFile(corruptedConfig.path, host); - - checkProgramActualFiles(watch(), [file1.path]); - }); + const watch = createWatchModeWithoutConfigFile(["/a/b/commonFile1.ts"], host); - it("correctly handles changes in lib section of config file", () => { - const libES5 = { - path: "/compiler/lib.es5.d.ts", - content: "declare const eval: any" - }; - const libES2015Promise = { - path: "/compiler/lib.es2015.promise.d.ts", - content: "declare class Promise {}" - }; - const app = { - path: "/src/app.ts", - content: "var x: Promise;" - }; - const config1 = { - path: "/src/tsconfig.json", - content: JSON.stringify( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: true, - sourceMap: false, - lib: [ - "es5" - ] - } - }) - }; - const config2 = { - path: config1.path, - content: JSON.stringify( - { - compilerOptions: { - module: "commonjs", - target: "es5", - noImplicitAny: true, - sourceMap: false, - lib: [ - "es5", - "es2015.promise" - ] - } - }) - }; - const host = createWatchedSystem([libES5, libES2015Promise, app, config1], { executingFilePath: "/compiler/tsc.js" }); - const watch = createWatchModeWithConfigFile(config1.path, host); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts"]); + checkProgramActualFiles(watch(), ["/a/b/commonFile1.ts", mocks.MockServerHost.libPath]); + checkOutputErrors(host, [ + createFileNotFoundDiagnostic(watch(), "/a/b/commonFile1.ts", file1Content, "commonFile2.ts", "/a/b/commonFile2.ts"), + createCannotFindNameDiagnostic(watch(), "/a/b/commonFile1.ts", file1Content, "y"), + ], /*isInitial*/ true); - checkProgramActualFiles(watch(), [libES5.path, app.path]); + host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts"]); + checkProgramActualFiles(watch(), ["/a/b/commonFile1.ts", mocks.MockServerHost.libPath, "/a/b/commonFile2.ts"]); + checkOutputErrors(host, emptyArray); + }); - host.reloadFS([libES5, libES2015Promise, app, config2]); - host.checkTimeoutQueueLengthAndRun(1); - checkProgramActualFiles(watch(), [libES5.path, libES2015Promise.path, app.path]); - }); + it("should reflect change in config file", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); + host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"] }`); - it("should handle non-existing directories in config file", () => { - const f = { - path: "/a/src/app.ts", - content: "let x = 1;" - }; - const config = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: {}, - include: [ - "src/**/*", - "notexistingfolder/*" - ] - }) - }; - const host = createWatchedSystem([f, config]); - const watch = createWatchModeWithConfigFile(config.path, host); - checkProgramActualFiles(watch(), [f.path]); - }); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"]); - it("rename a module file and rename back should restore the states for inferred projects", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: 'import * as T from "./moduleFile"; T.bar();' - }; - const host = createWatchedSystem([moduleFile, file1, libFile]); - const watch = createWatchModeWithoutConfigFile([file1.path], host); - checkOutputErrors(host, emptyArray, /*isInitial*/ true); - - const moduleFileOldPath = moduleFile.path; - const moduleFileNewPath = "/a/b/moduleFile1.ts"; - moduleFile.path = moduleFileNewPath; - host.reloadFS([moduleFile, file1, libFile]); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile") - ]); - - moduleFile.path = moduleFileOldPath; - host.reloadFS([moduleFile, file1, libFile]); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, emptyArray); - }); + host.vfs.writeFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["/a/b/commonFile1.ts"] }`); + host.checkTimeoutQueueLengthAndRun(1); // reload the configured project + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts"]); + }); - it("rename a module file and rename back should restore the states for configured projects", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: 'import * as T from "./moduleFile"; T.bar();' - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - const host = createWatchedSystem([moduleFile, file1, configFile, libFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkOutputErrors(host, emptyArray, /*isInitial*/ true); - - const moduleFileOldPath = moduleFile.path; - const moduleFileNewPath = "/a/b/moduleFile1.ts"; - moduleFile.path = moduleFileNewPath; - host.reloadFS([moduleFile, file1, configFile, libFile]); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile") - ]); - - moduleFile.path = moduleFileOldPath; - host.reloadFS([moduleFile, file1, configFile, libFile]); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, emptyArray); - }); + it("files explicitly excluded in config file", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); + host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); + host.vfs.addFile("/a/c/excludedFile1.ts", `let t = 1;`); + host.vfs.addFile("/a/tsconfig.json", `{ "compilerOptions": {}, "exclude": ["/a/c"] }`); - it("types should load from config file path if config exists", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { types: ["node"], typeRoots: [] } }) - }; - const node = { - path: "/a/b/node_modules/@types/node/index.d.ts", - content: "declare var process: any" - }; - const cwd = { - path: "/a/c" - }; - const host = createWatchedSystem([f1, config, node, cwd], { currentDirectory: cwd.path }); - const watch = createWatchModeWithConfigFile(config.path, host); - - checkProgramActualFiles(watch(), [f1.path, node.path]); - }); + const watch = createWatchModeWithConfigFile("/a/tsconfig.json", host); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"]); + }); - it("add the missing module file for inferred project: should remove the `module not found` error", () => { - const moduleFile = { - path: "/a/b/moduleFile.ts", - content: "export function bar() { };" - }; - const file1 = { - path: "/a/b/file1.ts", - content: 'import * as T from "./moduleFile"; T.bar();' - }; - const host = createWatchedSystem([file1, libFile]); - const watch = createWatchModeWithoutConfigFile([file1.path], host); - - checkOutputErrors(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile") - ], /*isInitial*/ true); - - host.reloadFS([file1, moduleFile, libFile]); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, emptyArray); - }); + it("should properly handle module resolution changes in config file", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/file1.ts", `import { T } from "module1";`); + host.vfs.addFile("/a/b/node_modules/module1.ts", `export interface T {}`); + host.vfs.addFile("/a/module1.ts", `export interface T {}`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": { "moduleResolution": "node" }, "files": ["/a/b/file1.ts"] }`); - it("Configure file diagnostics events are generated when the config file has errors", () => { - const file = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "foo": "bar", - "allowJS": true - } - }` - }; - - const host = createWatchedSystem([file, configFile, libFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkOutputErrors(host, [ - getUnknownCompilerOption(watch(), configFile, "foo"), - getUnknownCompilerOption(watch(), configFile, "allowJS") - ], /*isInitial*/ true); - }); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramRootFiles(watch(), ["/a/b/file1.ts"]); + checkProgramActualFiles(watch(), ["/a/b/file1.ts", "/a/b/node_modules/module1.ts"]); - it("If config file doesnt have errors, they are not reported", () => { - const file = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {} - }` - }; - - const host = createWatchedSystem([file, configFile, libFile]); - createWatchModeWithConfigFile(configFile.path, host); - checkOutputErrors(host, emptyArray, /*isInitial*/ true); - }); + host.vfs.writeFile("/a/b/tsconfig.json", `{ "compilerOptions": { "moduleResolution": "classic" }, "files": ["/a/b/file1.ts"] }`); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramRootFiles(watch(), ["/a/b/file1.ts"]); + checkProgramActualFiles(watch(), ["/a/b/file1.ts", "/a/module1.ts"]); + }); - it("Reports errors when the config file changes", () => { - const file = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {} - }` - }; - - const host = createWatchedSystem([file, configFile, libFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkOutputErrors(host, emptyArray, /*isInitial*/ true); - - configFile.content = `{ - "compilerOptions": { - "haha": 123 - } - }`; - host.reloadFS([file, configFile, libFile]); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, [ - getUnknownCompilerOption(watch(), configFile, "haha") - ]); - - configFile.content = `{ - "compilerOptions": {} - }`; - host.reloadFS([file, configFile, libFile]); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, emptyArray); - }); + it("should tolerate config file errors and still try to build a project", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); + host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); + host.vfs.addFile("/a/b/tsconfig.json", + `{\n` + + ` "compilerOptions": {\n` + + ` "target": "es6",\n` + + ` "allowAnything": true\n` + + ` },\n` + + ` "someOtherProperty": {}\n` + + `}`); + + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"]); + }); - it("non-existing directories listed in config file input array should be tolerated without crashing the server", () => { - const configFile = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {}, - "include": ["app/*", "test/**/*", "something"] - }` - }; - const file1 = { - path: "/a/b/file1.ts", - content: "let t = 10;" - }; - - const host = createWatchedSystem([file1, configFile, libFile]); - const watch = createWatchModeWithConfigFile(configFile.path, host); - - checkProgramActualFiles(watch(), [libFile.path]); - }); + it("changes in files are reflected in project structure", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/f1.ts", `export * from "./f2"`); + host.vfs.addFile("/a/b/f2.ts", `export let x = 1`); + host.vfs.addFile("/a/c/f3.ts", `export let y = 1;`); - it("non-existing directories listed in config file input array should be able to handle @types if input file list is empty", () => { - const f = { - path: "/a/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compiler: {}, - files: [] - }) - }; - const t1 = { - path: "/a/node_modules/@types/typings/index.d.ts", - content: `export * from "./lib"` - }; - const t2 = { - path: "/a/node_modules/@types/typings/lib.d.ts", - content: `export const x: number` - }; - const host = createWatchedSystem([f, config, t1, t2], { currentDirectory: getDirectoryPath(f.path) }); - const watch = createWatchModeWithConfigFile(config.path, host); - - checkProgramActualFiles(watch(), [t1.path, t2.path]); - }); + const watch = createWatchModeWithoutConfigFile(["/a/b/f1.ts"], host); + checkProgramRootFiles(watch(), ["/a/b/f1.ts"]); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts"]); - it("should support files without extensions", () => { - const f = { - path: "/a/compile", - content: "let x = 1" - }; - const host = createWatchedSystem([f, libFile]); - const watch = createWatchModeWithoutConfigFile([f.path], host, { allowNonTsExtensions: true }); - checkProgramActualFiles(watch(), [f.path, libFile.path]); - }); + host.vfs.writeFile("/a/b/f2.ts", `export * from "../c/f3"`); // now inferred project should inclule file3 + host.checkTimeoutQueueLengthAndRun(1); + checkProgramRootFiles(watch(), ["/a/b/f1.ts"]); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts", "/a/c/f3.ts"]); + }); - it("Options Diagnostic locations reported correctly with changes in configFile contents when options change", () => { - const file = { - path: "/a/b/app.ts", - content: "let x = 10" - }; - const configFileContentBeforeComment = `{`; - const configFileContentComment = ` - // comment - // More comment`; - const configFileContentAfterComment = ` - "compilerOptions": { - "allowJs": true, - "declaration": true - } - }`; - const configFileContentWithComment = configFileContentBeforeComment + configFileContentComment + configFileContentAfterComment; - const configFileContentWithoutCommentLine = configFileContentBeforeComment + configFileContentAfterComment; - const configFile = { - path: "/a/b/tsconfig.json", - content: configFileContentWithComment - }; - - const files = [file, libFile, configFile]; - const host = createWatchedSystem(files); - const watch = createWatchModeWithConfigFile(configFile.path, host); - const errors = () => [ - getDiagnosticOfFile(watch().getCompilerOptions().configFile, configFile.content.indexOf('"allowJs"'), '"allowJs"'.length, Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration"), - getDiagnosticOfFile(watch().getCompilerOptions().configFile, configFile.content.indexOf('"declaration"'), '"declaration"'.length, Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration") - ]; - const intialErrors = errors(); - checkOutputErrors(host, intialErrors, /*isInitial*/ true); - - configFile.content = configFileContentWithoutCommentLine; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - const nowErrors = errors(); - checkOutputErrors(host, nowErrors); - assert.equal(nowErrors[0].start, intialErrors[0].start - configFileContentComment.length); - assert.equal(nowErrors[1].start, intialErrors[1].start - configFileContentComment.length); - }); - }); + it("deleted files affect project structure", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/f1.ts", `export * from "./f2"`); + host.vfs.addFile("/a/b/f2.ts", `export * from "../c/f3"`); + host.vfs.addFile("/a/c/f3.ts", `export let y = 1;`); - describe("tsc-watch emit with outFile or out setting", () => { - function createWatchForOut(out?: string, outFile?: string) { - const host = createWatchedSystem([]); - const config: FileOrFolderEmit = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { listEmittedFiles: true } - }) - }; - - let getOutput: (file: FileOrFolder) => string; - if (out) { - config.content = JSON.stringify({ - compilerOptions: { listEmittedFiles: true, out } - }); - getOutput = __ => getEmittedLineForSingleFileOutput(out, host); - } - else if (outFile) { - config.content = JSON.stringify({ - compilerOptions: { listEmittedFiles: true, outFile } - }); - getOutput = __ => getEmittedLineForSingleFileOutput(outFile, host); - } - else { - getOutput = file => getEmittedLineForMultiFileOutput(file, host); - } + const watch = createWatchModeWithoutConfigFile(["/a/b/f1.ts"], host); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts", "/a/c/f3.ts"]); - const f1 = getFileOrFolderEmit({ - path: "/a/a.ts", - content: "let x = 1" - }, getOutput); - const f2 = getFileOrFolderEmit({ - path: "/a/b.ts", - content: "let y = 1" - }, getOutput); - - const files = [f1, f2, config, libFile]; - host.reloadFS(files); - createWatchModeWithConfigFile(config.path, host); - - const allEmittedLines = getEmittedLines(files); - checkOutputContains(host, allEmittedLines); - host.clearOutput(); - - f1.content = "let x = 11"; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - checkAffectedLines(host, [f1], allEmittedLines); - } + host.vfs.removeFile("/a/b/f2.ts"); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramActualFiles(watch(), ["/a/b/f1.ts"]); + }); - it("projectUsesOutFile should not be returned if not set", () => { - createWatchForOut(); - }); + it("deleted files affect project structure - 2", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/f1.ts", `export * from "./f2"`); + host.vfs.addFile("/a/b/f2.ts", `export * from "../c/f3"`); + host.vfs.addFile("/a/c/f3.ts", `export let y = 1;`); - it("projectUsesOutFile should be true if out is set", () => { - const outJs = "/a/out.js"; - createWatchForOut(outJs); - }); + const watch = createWatchModeWithoutConfigFile(["/a/b/f1.ts", "/a/c/f3.ts"], host); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts", "/a/c/f3.ts"]); - it("projectUsesOutFile should be true if outFile is set", () => { - const outJs = "/a/out.js"; - createWatchForOut(/*out*/ undefined, outJs); - }); + host.vfs.removeFile("/a/b/f2.ts"); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/c/f3.ts"]); + }); - function verifyFilesEmittedOnce(useOutFile: boolean) { - const file1: FileOrFolder = { - path: "/a/b/output/AnotherDependency/file1.d.ts", - content: "declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } }" - }; - const file2: FileOrFolder = { - path: "/a/b/dependencies/file2.d.ts", - content: "declare namespace Dependencies.SomeComponent { export class SomeClass { version: string; } }" - }; - const file3: FileOrFolder = { - path: "/a/b/project/src/main.ts", - content: "namespace Main { export function fooBar() {} }" - }; - const file4: FileOrFolder = { - path: "/a/b/project/src/main2.ts", - content: "namespace main.file4 { import DynamicMenu = Common.SomeComponent.DynamicMenu; export function foo(a: DynamicMenu.z) { } }" - }; - const configFile: FileOrFolder = { - path: "/a/b/project/tsconfig.json", - content: JSON.stringify({ - compilerOptions: useOutFile ? - { outFile: "../output/common.js", target: "es5" } : - { outDir: "../output", target: "es5" }, - files: [file1.path, file2.path, file3.path, file4.path] - }) - }; - const files = [file1, file2, file3, file4]; - const allfiles = files.concat(configFile); - const host = createWatchedSystem(allfiles); - const originalWriteFile = host.writeFile.bind(host); - const mapOfFilesWritten = createMap(); - host.writeFile = (p: string, content: string) => { - const count = mapOfFilesWritten.get(p); - mapOfFilesWritten.set(p, count ? count + 1 : 1); - return originalWriteFile(p, content); - }; - createWatchModeWithConfigFile(configFile.path, host); - if (useOutFile) { - // Only out file - assert.equal(mapOfFilesWritten.size, 1); - } - else { - // main.js and main2.js - assert.equal(mapOfFilesWritten.size, 2); - } - mapOfFilesWritten.forEach((value, key) => { - assert.equal(value, 1, "Key: " + key); + it("config file includes the file", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/f1.ts", `export let x = 5`); + host.vfs.addFile("/a/c/f2.ts", `import {x} from "../b/f1"`); + host.vfs.addFile("/a/c/f3.ts", `export let y = 1`); + host.vfs.addFile("/a/c/tsconfig.json", `{ "compilerOptions": {}, "files": ["f2.ts", "f3.ts"] }`); + + const watch = createWatchModeWithConfigFile("/a/c/tsconfig.json", host); + checkProgramRootFiles(watch(), ["/a/c/f2.ts", "/a/c/f3.ts"]); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/c/f2.ts", "/a/c/f3.ts"]); }); - } - it("with --outFile and multiple declaration files in the program", () => { - verifyFilesEmittedOnce(/*useOutFile*/ true); - }); + it("correctly migrate files between projects", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/f1.ts", + `export * from "../c/f2";\n` + + `export * from "../d/f3";`); + host.vfs.addFile("/a/c/f2.ts", `export let x = 1;`); + host.vfs.addFile("/a/d/f3.ts", `export let y = 1;`); - it("without --outFile and multiple declaration files in the program", () => { - verifyFilesEmittedOnce(/*useOutFile*/ false); - }); - }); + const watch1 = createWatchModeWithoutConfigFile(["/a/c/f2.ts", "/a/d/f3.ts"], host); + checkProgramActualFiles(watch1(), ["/a/c/f2.ts", "/a/d/f3.ts"]); - describe("tsc-watch emit for configured projects", () => { - const file1Consumer1Path = "/a/b/file1Consumer1.ts"; - const moduleFile1Path = "/a/b/moduleFile1.ts"; - const configFilePath = "/a/b/tsconfig.json"; - interface InitialStateParams { - /** custom config file options */ - configObj?: any; - /** list of the files that will be emitted for first compilation */ - firstCompilationEmitFiles?: string[]; - /** get the emit file for file - default is multi file emit line */ - getEmitLine?(file: FileOrFolder, host: WatchedSystem): string; - /** Additional files and folders to add */ - getAdditionalFileOrFolder?(): FileOrFolder[]; - /** initial list of files to emit if not the default list */ - firstReloadFileList?: string[]; - } - function getInitialState({ configObj = {}, firstCompilationEmitFiles, getEmitLine, getAdditionalFileOrFolder, firstReloadFileList }: InitialStateParams = {}) { - const host = createWatchedSystem([]); - const getOutputName = getEmitLine ? (file: FileOrFolder) => getEmitLine(file, host) : - (file: FileOrFolder) => getEmittedLineForMultiFileOutput(file, host); - - const moduleFile1 = getFileOrFolderEmit({ - path: moduleFile1Path, - content: "export function Foo() { };", - }, getOutputName); - - const file1Consumer1 = getFileOrFolderEmit({ - path: file1Consumer1Path, - content: `import {Foo} from "./moduleFile1"; export var y = 10;`, - }, getOutputName); - - const file1Consumer2 = getFileOrFolderEmit({ - path: "/a/b/file1Consumer2.ts", - content: `import {Foo} from "./moduleFile1"; let z = 10;`, - }, getOutputName); - - const moduleFile2 = getFileOrFolderEmit({ - path: "/a/b/moduleFile2.ts", - content: `export var Foo4 = 10;`, - }, getOutputName); - - const globalFile3 = getFileOrFolderEmit({ - path: "/a/b/globalFile3.ts", - content: `interface GlobalFoo { age: number }` + const watch2 = createWatchModeWithoutConfigFile(["/a/b/f1.ts"], host); + checkProgramActualFiles(watch2(), ["/a/b/f1.ts", "/a/c/f2.ts", "/a/d/f3.ts"]); + + // Previous program shouldnt be updated + checkProgramActualFiles(watch1(), ["/a/c/f2.ts", "/a/d/f3.ts"]); + host.checkTimeoutQueueLength(0); }); - const additionalFiles = getAdditionalFileOrFolder ? - map(getAdditionalFileOrFolder(), file => getFileOrFolderEmit(file, getOutputName)) : - []; + it("can correctly update configured project when set of root files has changed (new file on disk)", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/f1.ts", `let x = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); + + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramActualFiles(watch(), ["/a/b/f1.ts"]); - (configObj.compilerOptions || (configObj.compilerOptions = {})).listEmittedFiles = true; - const configFile = getFileOrFolderEmit({ - path: configFilePath, - content: JSON.stringify(configObj) + host.vfs.addFile("/a/b/f2.ts", `let y = 1`); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts"]); + checkProgramRootFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts"]); }); - const files = [moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile, ...additionalFiles]; - let allEmittedFiles = getEmittedLines(files); - host.reloadFS(firstReloadFileList ? getFiles(firstReloadFileList) : files); + it("can correctly update configured project when set of root files has changed (new file in list of files)", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/f1.ts", `let x = 1`); + host.vfs.addFile("/a/b/f2.ts", `let y = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["f1.ts"] }`); - // Initial compile - createWatchModeWithConfigFile(configFile.path, host); - if (firstCompilationEmitFiles) { - checkAffectedLines(host, getFiles(firstCompilationEmitFiles), allEmittedFiles); - } - else { - checkOutputContains(host, allEmittedFiles); - } - host.clearOutput(); - - return { - moduleFile1, file1Consumer1, file1Consumer2, moduleFile2, globalFile3, configFile, - files, - getFile, - verifyAffectedFiles, - verifyAffectedAllFiles, - getOutputName - }; - - function getFiles(filelist: string[]) { - return map(filelist, getFile); - } + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramActualFiles(watch(), ["/a/b/f1.ts"]); - function getFile(fileName: string) { - return find(files, file => file.path === fileName); - } + host.vfs.writeFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["f1.ts", "f2.ts"] }`); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramRootFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts"]); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts"]); + }); + + it("can update configured project when set of root files was not changed", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/f1.ts", `let x = 1`); + host.vfs.addFile("/a/b/f2.ts", `let y = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["f1.ts", "f2.ts"] }`); + + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts"]); - function verifyAffectedAllFiles() { - host.reloadFS(files); + host.vfs.writeFile("/a/b/tsconfig.json", `{ "compilerOptions": { "outFile": "out.js" }, "files": ["f1.ts", "f2.ts"] }`); host.checkTimeoutQueueLengthAndRun(1); - checkOutputContains(host, allEmittedFiles); - host.clearOutput(); - } + checkProgramRootFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts"]); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts"]); + }); - function verifyAffectedFiles(expected: FileOrFolderEmit[], filesToReload?: FileOrFolderEmit[]) { - if (!filesToReload) { - filesToReload = files; - } - else if (filesToReload.length > files.length) { - allEmittedFiles = getEmittedLines(filesToReload); - } - host.reloadFS(filesToReload); + it("config file is deleted", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/f1.ts", `let x = 1`); + host.vfs.addFile("/a/b/f2.ts", `let y = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); + + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts", mocks.MockServerHost.libPath]); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); + + host.vfs.removeFile("/a/b/tsconfig.json"); host.checkTimeoutQueueLengthAndRun(1); - checkAffectedLines(host, expected, allEmittedFiles); - host.clearOutput(); - } - } - it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { - const { - moduleFile1, file1Consumer1, file1Consumer2, - verifyAffectedFiles - } = getInitialState(); + assert.equal(host.exitCode, ExitStatus.DiagnosticsPresent_OutputsSkipped); + checkOutputErrors(host, [ + createCompilerDiagnostic(Diagnostics.File_0_not_found, "/a/b/tsconfig.json") + ], /*isInitial*/ undefined, /*skipWaiting*/ true); + }); - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); + it("Proper errors: document is not contained in project", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/b/app.ts", ``); + host.vfs.addFile("/a/b/tsconfig.json", `{`); - // Change the content of moduleFile1 to `export var T: number;export function Foo() { console.log('hi'); };` - moduleFile1.content = `export var T: number;export function Foo() { console.log('hi'); };`; - verifyAffectedFiles([moduleFile1]); - }); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramActualFiles(watch(), ["/a/b/app.ts"]); + }); - it("should be up-to-date with the reference map changes", () => { - const { - moduleFile1, file1Consumer1, file1Consumer2, - verifyAffectedFiles - } = getInitialState(); + it("correctly handles changes in lib section of config file", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/.ts/lib.es5.d.ts", `declare const eval: any`); + host.vfs.addFile("/.ts/lib.es2015.promise.d.ts", `declare class Promise {}`); + host.vfs.addFile("/src/app.ts", `var x: Promise;`); + host.vfs.addFile("/src/tsconfig.json", `{ "compilerOptions": { "lib": ["es5"] } }`); - // Change file1Consumer1 content to `export let y = Foo();` - file1Consumer1.content = `export let y = Foo();`; - verifyAffectedFiles([file1Consumer1]); + const watch = createWatchModeWithConfigFile("/src/tsconfig.json", host); + checkProgramActualFiles(watch(), ["/.ts/lib.es5.d.ts", "/src/app.ts"]); - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer2]); + host.vfs.writeFile("/src/tsconfig.json", `{ "compilerOptions": { "lib": ["es5", "es2015.promise"] } }`); + host.checkTimeoutQueueLengthAndRun(1); + checkProgramActualFiles(watch(), ["/.ts/lib.es5.d.ts", "/.ts/lib.es2015.promise.d.ts", "/src/app.ts"]); + }); - // Add the import statements back to file1Consumer1 - file1Consumer1.content = `import {Foo} from "./moduleFile1";let y = Foo();`; - verifyAffectedFiles([file1Consumer1]); + it("should handle non-existing directories in config file", () => { + const host = new mocks.MockServerHost(); + host.vfs.addFile("/a/src/app.ts", `let x = 1;`); + host.vfs.addFile("/a/tsconfig.json", `{ "compilerOptions": {}, "include": ["src/**/*", "notexistingfolder/*"] }`); - // Change the content of moduleFile1 to `export var T: number;export var T2: string;export function Foo() { };` - moduleFile1.content = `export var T: number;export var T2: string;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer2, file1Consumer1]); + const watch = createWatchModeWithConfigFile("/a/tsconfig.json", host); + checkProgramActualFiles(watch(), ["/a/src/app.ts"]); + }); - // Multiple file edits in one go: + it("rename a module file and rename back should restore the states for inferred projects", () => { + const file1Content = `import * as T from "./moduleFile"; T.bar();`; + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/file1.ts", file1Content); + host.vfs.addFile("/a/b/moduleFile.ts", `export function bar() { };`); - // Change file1Consumer1 content to `export let y = Foo();` - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - file1Consumer1.content = `export let y = Foo();`; - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); - }); + const watch = createWatchModeWithoutConfigFile(["/a/b/file1.ts"], host); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); - it("should be up-to-date with deleted files", () => { - const { - moduleFile1, file1Consumer1, file1Consumer2, - files, - verifyAffectedFiles - } = getInitialState(); + host.vfs.removeFile("/a/b/moduleFile.js"); + host.vfs.rename("/a/b/moduleFile.ts", "/a/b/moduleFile1.ts"); - // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` - moduleFile1.content = `export var T: number;export function Foo() { };`; + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, [ + createCannotFindModuleDiagnostic(watch(), "/a/b/file1.ts", file1Content, "./moduleFile") + ]); - // Delete file1Consumer2 - const filesToLoad = mapDefined(files, file => file === file1Consumer2 ? undefined : file); - verifyAffectedFiles([moduleFile1, file1Consumer1], filesToLoad); - }); + host.vfs.removeFile("/a/b/moduleFile1.js"); + host.vfs.rename("/a/b/moduleFile1.ts", "/a/b/moduleFile.ts"); - it("should be up-to-date with newly created files", () => { - const { - moduleFile1, file1Consumer1, file1Consumer2, - files, - verifyAffectedFiles, - getOutputName - } = getInitialState(); - - const file1Consumer3 = getFileOrFolderEmit({ - path: "/a/b/file1Consumer3.ts", - content: `import {Foo} from "./moduleFile1"; let y = Foo();` - }, getOutputName); - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer3, file1Consumer2], files.concat(file1Consumer3)); - }); + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, emptyArray); + }); - it("should detect changes in non-root files", () => { - const { - moduleFile1, file1Consumer1, - verifyAffectedFiles - } = getInitialState({ configObj: { files: [file1Consumer1Path] }, firstCompilationEmitFiles: [file1Consumer1Path, moduleFile1Path] }); + it("rename a module file and rename back should restore the states for configured projects", () => { + const file1Content = `import * as T from "./moduleFile"; T.bar();`; + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/file1.ts", file1Content); + host.vfs.addFile("/a/b/moduleFile.ts", `export function bar() { };`); + host.vfs.addFile("/a/b/tsconfig.json", `{}`); - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1]); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); - // change file1 internal, and verify only file1 is affected - moduleFile1.content += "var T1: number;"; - verifyAffectedFiles([moduleFile1]); - }); + host.vfs.removeFile("/a/b/moduleFile.js"); + host.vfs.rename("/a/b/moduleFile.ts", "/a/b/moduleFile1.ts"); - it("should return all files if a global file changed shape", () => { - const { - globalFile3, verifyAffectedAllFiles - } = getInitialState(); + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, [ + createCannotFindModuleDiagnostic(watch(), "/a/b/file1.ts", file1Content, "./moduleFile") + ]); - globalFile3.content += "var T2: string;"; - verifyAffectedAllFiles(); - }); + host.vfs.removeFile("/a/b/moduleFile1.js"); + host.vfs.rename("/a/b/moduleFile1.ts", "/a/b/moduleFile.ts"); - it("should always return the file itself if '--isolatedModules' is specified", () => { - const { - moduleFile1, verifyAffectedFiles - } = getInitialState({ configObj: { compilerOptions: { isolatedModules: true } } }); + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, emptyArray); + }); - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1]); - }); + it("types should load from config file path if config exists", () => { + const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/c" }}); + host.vfs.addDirectory("/a/c"); + host.vfs.addFile("/a/b/app.ts", `let x = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": { "types": ["node"], "typeRoots": [] } }`); + host.vfs.addFile("/a/b/node_modules/@types/node/index.d.ts", `declare var process: any`); - it("should always return the file itself if '--out' or '--outFile' is specified", () => { - const outFilePath = "/a/b/out.js"; - const { - moduleFile1, verifyAffectedFiles - } = getInitialState({ - configObj: { compilerOptions: { module: "system", outFile: outFilePath } }, - getEmitLine: (_, host) => getEmittedLineForSingleFileOutput(outFilePath, host) - }); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramActualFiles(watch(), ["/a/b/app.ts", "/a/b/node_modules/@types/node/index.d.ts"]); + }); - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1]); - }); + it("add the missing module file for inferred project: should remove the `module not found` error", () => { + const file1Content = `import * as T from "./moduleFile"; T.bar();`; + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/file1.ts", file1Content); - it("should return cascaded affected file list", () => { - const file1Consumer1Consumer1: FileOrFolder = { - path: "/a/b/file1Consumer1Consumer1.ts", - content: `import {y} from "./file1Consumer1";` - }; - const { - moduleFile1, file1Consumer1, file1Consumer2, verifyAffectedFiles, getFile - } = getInitialState({ - getAdditionalFileOrFolder: () => [file1Consumer1Consumer1] - }); + const watch = createWatchModeWithoutConfigFile(["/a/b/file1.ts"], host); - const file1Consumer1Consumer1Emit = getFile(file1Consumer1Consumer1.path); - file1Consumer1.content += "export var T: number;"; - verifyAffectedFiles([file1Consumer1, file1Consumer1Consumer1Emit]); + checkOutputErrors(host, [ + createCannotFindModuleDiagnostic(watch(), "/a/b/file1.ts", file1Content, "./moduleFile") + ], /*isInitial*/ true); - // Doesnt change the shape of file1Consumer1 - moduleFile1.content = `export var T: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2]); + host.vfs.addFile("/a/b/moduleFile.ts", `export function bar() { };`); - // Change both files before the timeout - file1Consumer1.content += "export var T2: number;"; - moduleFile1.content = `export var T2: number;export function Foo() { };`; - verifyAffectedFiles([moduleFile1, file1Consumer1, file1Consumer2, file1Consumer1Consumer1Emit]); - }); + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, emptyArray); + }); - it("should work fine for files with circular references", () => { - // TODO: do not exit on such errors? Just continue to watch the files for update in watch mode - - const file1: FileOrFolder = { - path: "/a/b/file1.ts", - content: ` - /// - export var t1 = 10;` - }; - const file2: FileOrFolder = { - path: "/a/b/file2.ts", - content: ` - /// - export var t2 = 10;` - }; - const { - configFile, - getFile, - verifyAffectedFiles - } = getInitialState({ - firstCompilationEmitFiles: [file1.path, file2.path], - getAdditionalFileOrFolder: () => [file1, file2], - firstReloadFileList: [libFile.path, file1.path, file2.path, configFilePath] - }); - const file1Emit = getFile(file1.path), file2Emit = getFile(file2.path); + it("Configure file diagnostics events are generated when the config file has errors", () => { + const configFileContent = `{ "compilerOptions": { "foo": "bar", "allowJS": true } }`; + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/app.ts", `let x = 10`); + host.vfs.addFile("/a/b/tsconfig.json", configFileContent); - file1Emit.content += "export var t3 = 10;"; - verifyAffectedFiles([file1Emit, file2Emit], [file1, file2, libFile, configFile]); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkOutputErrors(host, [ + createUnknownCompilerOptionDiagnostic(watch(), configFileContent, "foo"), + createUnknownCompilerOptionDiagnostic(watch(), configFileContent, "allowJS") + ], /*isInitial*/ true); + }); - }); + it("If config file doesnt have errors, they are not reported", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/app.ts", `let x = 10`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); - it("should detect removed code file", () => { - const referenceFile1: FileOrFolder = { - path: "/a/b/referenceFile1.ts", - content: ` - /// - export var x = Foo();` - }; - const { - configFile, - getFile, - verifyAffectedFiles - } = getInitialState({ - firstCompilationEmitFiles: [referenceFile1.path, moduleFile1Path], - getAdditionalFileOrFolder: () => [referenceFile1], - firstReloadFileList: [libFile.path, referenceFile1.path, moduleFile1Path, configFilePath] - }); + createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); + }); - const referenceFile1Emit = getFile(referenceFile1.path); - verifyAffectedFiles([referenceFile1Emit], [libFile, referenceFile1Emit, configFile]); - }); + it("Reports errors when the config file changes", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/app.ts", `let x = 10`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); - it("should detect non-existing code file", () => { - const referenceFile1: FileOrFolder = { - path: "/a/b/referenceFile1.ts", - content: ` - /// - export var x = Foo();` - }; - const { - configFile, - moduleFile2, - getFile, - verifyAffectedFiles - } = getInitialState({ - firstCompilationEmitFiles: [referenceFile1.path], - getAdditionalFileOrFolder: () => [referenceFile1], - firstReloadFileList: [libFile.path, referenceFile1.path, configFilePath] - }); + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); + + const configFileBadContent = `{ "compilerOptions": { "haha": 123 } }`; + host.vfs.writeFile("/a/b/tsconfig.json", configFileBadContent); + + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, [ + createUnknownCompilerOptionDiagnostic(watch(), configFileBadContent, "haha") + ]); + + host.vfs.writeFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); + + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, emptyArray); + }); + + it("non-existing directories listed in config file input array should be tolerated without crashing the server", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/file1.ts", `let t = 10;`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "include": ["app/*", "test/**/*", "something"] }`); + + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkProgramActualFiles(watch(), [mocks.MockServerHost.libPath]); + }); + + it("non-existing directories listed in config file input array should be able to handle @types if input file list is empty", () => { + const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/" } }); + host.vfs.addFile("/a/app.ts", `let x = 1`); + host.vfs.addFile("/a/tsconfig.json", `{ "compilerOptions": {}, "files": [] }`); + host.vfs.addFile("/a/node_modules/@types/typings/index.d.ts", `export * from "./lib"`); + host.vfs.addFile("/a/node_modules/@types/typings/lib.d.ts", `export const x: number`); + + const watch = createWatchModeWithConfigFile("/a/tsconfig.json", host); + + checkProgramActualFiles(watch(), ["/a/node_modules/@types/typings/index.d.ts", "/a/node_modules/@types/typings/lib.d.ts"]); + }); + + it("should support files without extensions", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/compile", `let x = 1`); - const referenceFile1Emit = getFile(referenceFile1.path); - referenceFile1Emit.content += "export var yy = Foo();"; - verifyAffectedFiles([referenceFile1Emit], [libFile, referenceFile1Emit, configFile]); + const watch = createWatchModeWithoutConfigFile(["/a/compile"], host, { allowNonTsExtensions: true }); + checkProgramActualFiles(watch(), ["/a/compile", mocks.MockServerHost.libPath]); + }); - // Create module File2 and see both files are saved - verifyAffectedFiles([referenceFile1Emit, moduleFile2], [libFile, moduleFile2, referenceFile1Emit, configFile]); + it("Options Diagnostic locations reported correctly with changes in configFile contents when options change", () => { + const configFileContentComment = + ` // comment\n` + + ` // More comment\n`; + const configFileContentWithComment = + `{\n` + + configFileContentComment + + ` "compilerOptions": {\n` + + ` "allowJs": true,\n` + + ` "declaration": true\n` + + ` }\n` + + `}`; + const configFileContentWithoutComment = + `{\n` + + ` "compilerOptions": {\n` + + ` "allowJs": true,\n` + + ` "declaration": true\n` + + ` }\n` + + `}`; + + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/b/app.ts", `let x = 10`); + host.vfs.addFile("/a/b/tsconfig.json", configFileContentWithComment); + + const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + const initialErrors = [ + createExclusiveCompilerOptionDiagnostic(watch(), configFileContentWithComment, "allowJs", "declaration", /*checkFirst*/ true), + createExclusiveCompilerOptionDiagnostic(watch(), configFileContentWithComment, "allowJs", "declaration", /*checkFirst*/ false) + ]; + checkOutputErrors(host, initialErrors, /*isInitial*/ true); + + host.vfs.writeFile("/a/b/tsconfig.json", configFileContentWithoutComment); + host.runQueuedTimeoutCallbacks(); + const nowErrors = [ + createExclusiveCompilerOptionDiagnostic(watch(), configFileContentWithoutComment, "allowJs", "declaration", /*checkFirst*/ true), + createExclusiveCompilerOptionDiagnostic(watch(), configFileContentWithoutComment, "allowJs", "declaration", /*checkFirst*/ false) + ]; + checkOutputErrors(host, nowErrors); + + assert.equal(nowErrors[0].start, initialErrors[0].start - configFileContentComment.length); + assert.equal(nowErrors[1].start, initialErrors[1].start - configFileContentComment.length); + }); }); - }); - describe("tsc-watch emit file content", () => { - interface EmittedFile extends FileOrFolder { - shouldBeWritten: boolean; - } - function getEmittedFiles(files: FileOrFolderEmit[], contents: string[]): EmittedFile[] { - return map(contents, (content, index) => { - return { - content, - path: changeExtension(files[index].path, Extension.Js), - shouldBeWritten: true + describe("emit once", () => { + function verifyFilesEmittedOnce(useOutFile: boolean) { + const configContent = JSON.stringify({ + compilerOptions: useOutFile ? + { outFile: "../output/common.js", target: "es5" } : + { outDir: "../output", target: "es5" }, + files: [ + "/a/b/output/AnotherDependency/file1.d.ts", + "/a/b/dependencies/file2.d.ts", + "/a/b/project/src/main.ts", + "/a/b/project/src/main2.ts" + ] + }); + + const filesWritten = new Map(); + const host = new class extends mocks.MockServerHost { + writeFile(path: string, data: string) { + filesWritten.set(path, (filesWritten.get(path) || 0) + 1); + super.writeFile(path, data); + } }; - } - ); - } - function verifyEmittedFiles(host: WatchedSystem, emittedFiles: EmittedFile[]) { - for (const { path, content, shouldBeWritten } of emittedFiles) { - if (shouldBeWritten) { - assert.isTrue(host.fileExists(path), `Expected file ${path} to be present`); - assert.equal(host.readFile(path), content, `Contents of file ${path} do not match`); + + host.vfs.addFile("/a/b/output/AnotherDependency/file1.d.ts", `declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } }`); + host.vfs.addFile("/a/b/dependencies/file2.d.ts", `declare namespace Dependencies.SomeComponent { export class SomeClass { version: string; } }`); + host.vfs.addFile("/a/b/project/src/main.ts", `namespace Main { export function fooBar() { } }`); + host.vfs.addFile("/a/b/project/src/main2.ts", `namespace main.file4 { import DynamicMenu = Common.SomeComponent.DynamicMenu; export function foo(a: DynamicMenu.z) { } }`); + host.vfs.addFile("/a/b/project/tsconfig.json", configContent); + + createWatchModeWithConfigFile("/a/b/project/tsconfig.json", host); + + if (useOutFile) { + // Only out file + assert.equal(filesWritten.size, 1); } else { - assert.isNotTrue(host.fileExists(path), `Expected file ${path} to be absent`); + // main.js and main2.js + assert.equal(filesWritten.size, 2); } + + filesWritten.forEach((value, key) => { + assert.equal(value, 1, "Key: " + key); + }); } - } - function verifyEmittedFileContents(newLine: string, inputFiles: FileOrFolder[], initialEmittedFileContents: string[], - modifyFiles: (files: FileOrFolderEmit[], emitedFiles: EmittedFile[]) => FileOrFolderEmit[], configFile?: FileOrFolder) { - const host = createWatchedSystem([], { newLine }); - const files = concatenate( - map(inputFiles, file => getFileOrFolderEmit(file, fileToConvert => getEmittedLineForMultiFileOutput(fileToConvert, host))), - configFile ? [libFile, configFile] : [libFile] - ); - const allEmittedFiles = getEmittedLines(files); - host.reloadFS(files); - - // Initial compile - if (configFile) { - createWatchModeWithConfigFile(configFile.path, host); + it("with --outFile and multiple declaration files in the program", () => { + verifyFilesEmittedOnce(/*useOutFile*/ true); + }); + + it("without --outFile and multiple declaration files in the program", () => { + verifyFilesEmittedOnce(/*useOutFile*/ false); + }); + }); + + describe("emit", () => { + function writeFile(host: mocks.MockServerHost, path: string, content: string) { + host.vfs.writeFile(path, content); } - else { - // First file as the root - createWatchModeWithoutConfigFile([files[0].path], host, { listEmittedFiles: true }); + + function writeConfigFile(host: mocks.MockServerHost, path: string, config: any = {}) { + const compilerOptions = (config.compilerOptions || (config.compilerOptions = {})); + compilerOptions.listEmittedFiles = true; + writeFile(host, path, JSON.stringify(config)); } - checkOutputContains(host, allEmittedFiles); - const emittedFiles = getEmittedFiles(files, initialEmittedFileContents); - verifyEmittedFiles(host, emittedFiles); - host.clearOutput(); + function waitAndCheckAffectedFiles(host: mocks.MockServerHost, affectedFiles: ReadonlyArray, unaffectedFiles?: ReadonlyArray) { + host.checkTimeoutQueueLengthAndRun(1); + checkAffectedFiles(host, affectedFiles, unaffectedFiles); + } - const affectedFiles = modifyFiles(files, emittedFiles); - host.reloadFS(files); - host.checkTimeoutQueueLengthAndRun(1); - checkAffectedLines(host, affectedFiles, allEmittedFiles); + function checkAffectedFiles(host: mocks.MockServerHost, affectedFiles: ReadonlyArray, unaffectedFiles?: ReadonlyArray) { + affectedFiles = getEmittedLines(affectedFiles, host, formatOutputFile); + checkOutputContains(host, affectedFiles); + if (unaffectedFiles) { + unaffectedFiles = getEmittedLines(unaffectedFiles, host, formatOutputFile); + unaffectedFiles = mapDefined(unaffectedFiles, line => contains(affectedFiles, line) ? undefined : line); + checkOutputDoesNotContain(host, unaffectedFiles); + } + host.clearOutput(); + } - verifyEmittedFiles(host, emittedFiles); - } + describe("affected files", () => { + describe("with --outFile or --out", () => { + const configFilePath = "/a/tsconfig.json"; + const file1Path = "/a/a.ts"; + const file1OutputPath = "/a/a.js"; + const file2Path = "/a/b.ts"; + const file2OutputPath = "/a/b.js"; + const commonOutputPaths: ReadonlyArray = [file1OutputPath, file2OutputPath]; + + function writeCommonFiles(host: mocks.MockServerHost) { + writeFile(host, file1Path, `let x = 1`); + writeFile(host, file2Path, `let y = 1`); + } - function verifyNewLine(newLine: string) { - const lines = ["var x = 1;", "var y = 2;"]; - const fileContent = lines.join(newLine); - const f = { - path: "/a/app.ts", - content: fileContent - }; + it("if neither is set", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath); - verifyEmittedFileContents(newLine, [f], [fileContent + newLine], modifyFiles); + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, commonOutputPaths); - function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { - files[0].content = fileContent + newLine + "var z = 3;"; - emittedFiles[0].content = files[0].content + newLine; - return [files[0]]; - } - } + writeFile(host, file1Path, `let x = 11`); + waitAndCheckAffectedFiles(host, [file1OutputPath], commonOutputPaths); + }); - it("handles new lines: \\n", () => { - verifyNewLine("\n"); - }); + it("if --out is set", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath, { compilerOptions: { out: "/a/out.js" } }); - it("handles new lines: \\r\\n", () => { - verifyNewLine("\r\n"); - }); + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, ["/a/out.js"], commonOutputPaths); - it("should emit specified file", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export function Foo() { return 10; }` - }; - - const file2 = { - path: "/a/b/f2.ts", - content: `import {Foo} from "./f1"; export let y = Foo();` - }; - - const file3 = { - path: "/a/b/f3.ts", - content: `import {y} from "./f2"; let x = y;` - }; - - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { listEmittedFiles: true } }) - }; - - verifyEmittedFileContents("\r\n", [file1, file2, file3], [ - `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`, - `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`, - `"use strict";\r\nexports.__esModule = true;\r\nvar f2_1 = require("./f2");\r\nvar x = f2_1.y;\r\n` - ], modifyFiles, configFile); - - function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { - files[0].content += `export function foo2() { return 2; }`; - emittedFiles[0].content += `function foo2() { return 2; }\r\nexports.foo2 = foo2;\r\n`; - emittedFiles[2].shouldBeWritten = false; - return files.slice(0, 2); - } - }); + writeFile(host, file1Path, `let x = 11`); + waitAndCheckAffectedFiles(host, ["/a/out.js"], commonOutputPaths); + }); - it("Elides const enums correctly in incremental compilation", () => { - const currentDirectory = "/user/someone/projects/myproject"; - const file1: FileOrFolder = { - path: `${currentDirectory}/file1.ts`, - content: "export const enum E1 { V = 1 }" - }; - const file2: FileOrFolder = { - path: `${currentDirectory}/file2.ts`, - content: `import { E1 } from "./file1"; export const enum E2 { V = E1.V }` - }; - const file3: FileOrFolder = { - path: `${currentDirectory}/file3.ts`, - content: `import { E2 } from "./file2"; const v: E2 = E2.V;` - }; - const strictAndEsModule = `"use strict";\nexports.__esModule = true;\n`; - verifyEmittedFileContents("\n", [file3, file2, file1], [ - `${strictAndEsModule}var v = 1 /* V */;\n`, - strictAndEsModule, - strictAndEsModule - ], modifyFiles); - - function modifyFiles(files: FileOrFolderEmit[], emittedFiles: EmittedFile[]) { - files[0].content += `function foo2() { return 2; }`; - emittedFiles[0].content += `function foo2() { return 2; }\n`; - emittedFiles[1].shouldBeWritten = false; - emittedFiles[2].shouldBeWritten = false; - return [files[0]]; - } + it("if --outFile is set", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath, { compilerOptions: { outFile: "/a/out.js" } }); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, ["/a/out.js"], commonOutputPaths); + + writeFile(host, file1Path, `let x = 11`); + waitAndCheckAffectedFiles(host, ["/a/out.js"], commonOutputPaths); + }); + + }); + + describe("for configured projects", () => { + const configFilePath = "/a/b/tsconfig.json"; + const file1Consumer1Path = "/a/b/file1Consumer1.ts"; + const file1Consumer1OutputPath = "/a/b/file1Consumer1.js"; + const file1Consumer2Path = "/a/b/file1Consumer2.ts"; + const file1Consumer2OutputPath = "/a/b/file1Consumer2.js"; + const moduleFile1Path = "/a/b/moduleFile1.ts"; + const moduleFile1OutputPath = "/a/b/moduleFile1.js"; + const moduleFile2Path = "/a/b/moduleFile2.ts"; + const moduleFile2OutputPath = "/a/b/moduleFile2.js"; + const globalFile3Path = "/a/b/globalFile3.ts"; + const globalFile3OutputPath = "/a/b/globalFile3.js"; + const commonOutputPaths: ReadonlyArray = [ + file1Consumer1OutputPath, + file1Consumer2OutputPath, + moduleFile1OutputPath, + moduleFile2OutputPath, + globalFile3OutputPath + ]; + + function writeCommonFiles(host: mocks.MockServerHost, files?: string[]) { + if (!files || ts.contains(files, moduleFile1Path)) { + writeFile(host, moduleFile1Path, `export function Foo() { };`); + } + if (!files || ts.contains(files, moduleFile2Path)) { + writeFile(host, moduleFile2Path, `export var Foo4 = 10;`); + } + if (!files || ts.contains(files, file1Consumer1Path)) { + writeFile(host, file1Consumer1Path, `import {Foo} from "./moduleFile1"; export var y = 10;`); + } + if (!files || ts.contains(files, file1Consumer2Path)) { + writeFile(host, file1Consumer2Path, `import {Foo} from "./moduleFile1"; let z = 10;`); + } + if (!files || ts.contains(files, globalFile3Path)) { + writeFile(host, globalFile3Path, `interface GlobalFoo { age: number }`); + } + } + + it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, commonOutputPaths); + + // Make a change to moduleFile1 that changes its external shape + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath, file1Consumer2OutputPath], commonOutputPaths); + + // Make a change to moduleFile1 that does not change its external shape + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { console.log('hi'); };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath], commonOutputPaths); + }); + + it("should be up-to-date with the reference map changes", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, commonOutputPaths); + + // Remove import of moduleFile1 from file1Consumer1. Should only affect itself. + writeFile(host, file1Consumer1Path, `export let y = Foo();`); + waitAndCheckAffectedFiles(host, [file1Consumer1OutputPath], commonOutputPaths); + + // Add additional export to moduleFile1. Should not affect file1Consumer1 + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer2OutputPath], commonOutputPaths); + + // Restore import of moduleFile1 to file1Consumer1. Should only affect itself. + writeFile(host, file1Consumer1Path, `import {Foo} from "./moduleFile1";let y = Foo();`); + waitAndCheckAffectedFiles(host, [file1Consumer1OutputPath], commonOutputPaths); + + // Add additional export to moduleFile1. Should now also affect file1Consumer1. + writeFile(host, moduleFile1Path, `export var T: number;export var T2: string;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath, file1Consumer2OutputPath], commonOutputPaths); + + // Multiple file edits in one go. + writeFile(host, file1Consumer1Path, `export let y = Foo();`); + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath, file1Consumer2OutputPath], commonOutputPaths); + }); + + it("should be up-to-date with deleted files", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, commonOutputPaths); + + // Change the content of moduleFile1 to `export var T: number;export function Foo() { };` + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + + // Delete file1Consumer2 + host.vfs.removeFile(file1Consumer2Path); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath], commonOutputPaths); + }); + + it("should be up-to-date with newly created files", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, commonOutputPaths); + + writeFile(host, "/a/b/file1Consumer3.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath, "/a/b/file1Consumer3.js", file1Consumer2OutputPath], commonOutputPaths); + }); + + it("should detect changes in non-root files", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host, [file1Consumer1Path, moduleFile1Path]); + writeConfigFile(host, configFilePath, { files: [file1Consumer1Path] }); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, [file1Consumer1OutputPath, moduleFile1OutputPath]); + + // Add export to moduleFile1. Should affect moduleFile1 and file1Consumer1. + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath]); + + // Change moduleFile1 internal. Should only affect moduleFile1. + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };var T1: number;`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath], [file1Consumer1OutputPath]); + }); + + it("should return all files if a global file changed shape", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, commonOutputPaths); + + // Add declaration to global. Should affect all files. + writeFile(host, globalFile3Path, `interface GlobalFoo { age: number }\nvar T2: string;`); + waitAndCheckAffectedFiles(host, commonOutputPaths); + }); + + it("should always return the file itself if '--isolatedModules' is specified", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath, { compilerOptions: { isolatedModules: true } }); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, commonOutputPaths); + + // Add export to moduleFile1. Should only affect moduleFile1. + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath], commonOutputPaths); + }); + + it("should always return the file itself if '--out' or '--outFile' is specified", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath, { compilerOptions: { module: "system", outFile: "/a/b/out.js" } }); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, ["/a/b/out.js"]); + + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, ["/a/b/out.js"]); + }); + + it("should return cascaded affected file list", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeCommonFiles(host); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, commonOutputPaths); + + writeFile(host, "/a/b/file1Consumer1Consumer1.ts", `import {y} from "./file1Consumer1";`); + writeFile(host, file1Consumer1Path, `import {Foo} from "./moduleFile1"; export var y = 10; export var T: number;`) + waitAndCheckAffectedFiles(host, [file1Consumer1OutputPath, "/a/b/file1Consumer1Consumer1.js"], commonOutputPaths); + + // Doesn't change the shape of file1Consumer1 + writeFile(host, moduleFile1Path, `export var T: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath, file1Consumer2OutputPath], commonOutputPaths); + + // Change both files before the timeout + writeFile(host, file1Consumer1Path, `import {Foo} from "./moduleFile1"; export var y = 10; export var T: number; export var T2: number;`) + writeFile(host, moduleFile1Path, `export var T2: number;export function Foo() { };`); + waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath, file1Consumer2OutputPath, "/a/b/file1Consumer1Consumer1.js"], commonOutputPaths); + }); + + it("should work fine for files with circular references", () => { + // TODO: do not exit on such errors? Just continue to watch the files for update in watch mode + const host = new mocks.MockServerHost({ lib: true }); + writeFile(host, "/a/b/file1.ts", `/// \nexport var t1 = 10;`); + writeFile(host, "/a/b/file2.ts", `/// \nexport var t2 = 10;`); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, ["/a/b/file1.js", "/a/b/file2.js"]); + + writeFile(host, "/a/b/file1.ts", `/// \nexport var t1 = 10;\nexport var t3 = 10;`); + waitAndCheckAffectedFiles(host, ["/a/b/file1.js", "/a/b/file2.js"]); + }); + + it("should detect removed code file", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeFile(host, "/a/b/referenceFile1.ts", `/// \nexport var x = Foo();`); + writeCommonFiles(host, [moduleFile1Path]); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, ["/a/b/referenceFile1.js", moduleFile1OutputPath]); + + host.vfs.removeFile(moduleFile1Path); + waitAndCheckAffectedFiles(host, ["/a/b/referenceFile1.js"], [moduleFile1OutputPath]); + }); + + it("should detect non-existing code file", () => { + const host = new mocks.MockServerHost({ lib: true }); + writeFile(host, "/a/b/referenceFile1.ts", `/// \nexport var x = Foo();`); + writeConfigFile(host, configFilePath); + + createWatchModeWithConfigFile(configFilePath, host); + checkAffectedFiles(host, ["/a/b/referenceFile1.js"]); + + writeFile(host, "/a/b/referenceFile1.ts", `/// \nexport var x = Foo();\nexport var yy = Foo();`); + waitAndCheckAffectedFiles(host, ["/a/b/referenceFile1.js"]); + + writeCommonFiles(host, [moduleFile2Path]); + waitAndCheckAffectedFiles(host, ["/a/b/referenceFile1.js", moduleFile2OutputPath]); + }); + }); + }); + + describe("file content", () => { + theory("handles new lines", [ + { title: "\\r\\n", args: ["\r\n"] }, + { title: "\\n", args: ["\n"] } + ], (newLine: "\r\n" | "\n") => { + const host = new mocks.MockServerHost({ newLine }); + writeFile(host, "/a/app.ts", `var x = 1;${newLine}var y = 2;`); + + createWatchModeWithoutConfigFile(["/a/app.ts"], host, { listEmittedFiles: true }); + checkAffectedFiles(host, ["/a/app.js"]); + + assert.isTrue(host.fileExists("/a/app.js")); + assert.strictEqual(host.readFile("/a/app.js"), `var x = 1;${newLine}var y = 2;${newLine}`); + + writeFile(host, "/a/app.ts", `var x = 1;${newLine}var y = 2;${newLine}var z = 3;`); + waitAndCheckAffectedFiles(host, ["/a/app.js"]); + + assert.isTrue(host.fileExists("/a/app.js")); + assert.strictEqual(host.readFile("/a/app.js"), `var x = 1;${newLine}var y = 2;${newLine}var z = 3;${newLine}`); + }); + + it("should emit specified file", () => { + const filesWritten = new Set(); + const host = new class extends mocks.MockServerHost { + writeFile(path: string, content: string) { + filesWritten.add(path); + super.writeFile(path, content); + } + }({ newLine: "\r\n" }); + + writeFile(host, "/a/b/f1.ts", `export function Foo() { return 10; }`); + writeFile(host, "/a/b/f2.ts", `import {Foo} from "./f1"; export let y = Foo();`); + writeFile(host, "/a/b/f3.ts", `import {y} from "./f2"; let x = y;`); + writeConfigFile(host, "/a/b/tsconfig.json"); + + createWatchModeWithConfigFile("/a/b/tsconfig.json", host); + checkAffectedFiles(host, ["/a/b/f1.js", "/a/b/f2.js", "/a/b/f3.js"]); + + assert.isTrue(filesWritten.has("/a/b/f1.js")); + assert.strictEqual(host.readFile("/a/b/f1.js"), `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`); + + assert.isTrue(filesWritten.has("/a/b/f2.js")); + assert.strictEqual(host.readFile("/a/b/f2.js"), `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`); + + assert.isTrue(filesWritten.has("/a/b/f3.js")); + assert.strictEqual(host.readFile("/a/b/f3.js"), `"use strict";\r\nexports.__esModule = true;\r\nvar f2_1 = require("./f2");\r\nvar x = f2_1.y;\r\n`); + + filesWritten.clear(); + + writeFile(host, "/a/b/f1.ts", `export function Foo() { return 10; }export function foo2() { return 2; }`); + waitAndCheckAffectedFiles(host, ["/a/b/f1.js", "/a/b/f2.js"], ["/a/b/f3.js"]); + + assert.isTrue(filesWritten.has("/a/b/f1.js")); + assert.strictEqual(host.readFile("/a/b/f1.js"), `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\nfunction foo2() { return 2; }\r\nexports.foo2 = foo2;\r\n`); + + assert.isTrue(filesWritten.has("/a/b/f2.js")); + assert.strictEqual(host.readFile("/a/b/f2.js"), `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`); + + assert.isFalse(filesWritten.has("/a/b/f3.js")); + }); + + it("Elides const enums correctly in incremental compilation", () => { + const filesWritten = new Set(); + const host = new class extends mocks.MockServerHost { + writeFile(path: string, content: string) { + filesWritten.add(path); + super.writeFile(path, content); + } + }({ lib: true, newLine: "\n" }); + + writeFile(host, "/user/someone/projects/myproject/file1.ts", `export const enum E1 { V = 1 }`); + writeFile(host, "/user/someone/projects/myproject/file2.ts", `import { E1 } from "./file1"; export const enum E2 { V = E1.V }`); + writeFile(host, "/user/someone/projects/myproject/file3.ts", `import { E2 } from "./file2"; const v: E2 = E2.V;`); + + createWatchModeWithoutConfigFile(["/user/someone/projects/myproject/file1.ts", "/user/someone/projects/myproject/file2.ts", "/user/someone/projects/myproject/file3.ts"], host, { listEmittedFiles: true }); + checkAffectedFiles(host, ["/user/someone/projects/myproject/file1.js", "/user/someone/projects/myproject/file2.js", "/user/someone/projects/myproject/file3.js"]); + + assert.isTrue(filesWritten.has("/user/someone/projects/myproject/file1.js")); + assert.strictEqual(host.readFile("/user/someone/projects/myproject/file1.js"), `"use strict";\nexports.__esModule = true;\n`); + + assert.isTrue(filesWritten.has("/user/someone/projects/myproject/file2.js")); + assert.strictEqual(host.readFile("/user/someone/projects/myproject/file2.js"), `"use strict";\nexports.__esModule = true;\n`); + + assert.isTrue(filesWritten.has("/user/someone/projects/myproject/file3.js")); + assert.strictEqual(host.readFile("/user/someone/projects/myproject/file3.js"), `"use strict";\nexports.__esModule = true;\nvar v = 1 /* V */;\n`); + + filesWritten.clear(); + + writeFile(host, "/user/someone/projects/myproject/file1.ts", `export const enum E1 { V = 1 }function foo2() { return 2; }`); + waitAndCheckAffectedFiles(host, ["/user/someone/projects/myproject/file1.js"], ["/user/someone/projects/myproject/file2.js", "/user/someone/projects/myproject/file3.js"]); + + assert.isTrue(filesWritten.has("/user/someone/projects/myproject/file1.js")); + assert.strictEqual(host.readFile("/user/someone/projects/myproject/file1.js"), `"use strict";\nexports.__esModule = true;\nfunction foo2() { return 2; }\n`); + + assert.isFalse(filesWritten.has("/user/someone/projects/myproject/file2.js")); + assert.isFalse(filesWritten.has("/user/someone/projects/myproject/file3.js")); + }); + }); }); - }); - describe("tsc-watch module resolution caching", () => { - it("works", () => { - const root = { - path: "/a/d/f0.ts", - content: `import {x} from "f1"` - }; - const imported = { - path: "/a/f1.ts", - content: `foo()` - }; - - const files = [root, imported, libFile]; - const host = createWatchedSystem(files); - const watch = createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); - - const f1IsNotModule = getDiagnosticOfFileFromProgram(watch(), root.path, root.content.indexOf('"f1"'), '"f1"'.length, Diagnostics.File_0_is_not_a_module, imported.path); - const cannotFindFoo = getDiagnosticOfFileFromProgram(watch(), imported.path, imported.content.indexOf("foo"), "foo".length, Diagnostics.Cannot_find_name_0, "foo"); - - // ensure that imported file was found - checkOutputErrors(host, [f1IsNotModule, cannotFindFoo], /*isInitial*/ true); - - const originalFileExists = host.fileExists; - { - const newContent = `import {x} from "f1" - var x: string = 1;`; - root.content = newContent; - host.reloadFS(files); - - // patch fileExists to make sure that disk is not touched - host.fileExists = notImplemented; - - // trigger synchronization to make sure that import will be fetched from the cache + describe("module resolution caching", () => { + it("works", () => { + const rootContent1 = `import {x} from "f1"`; + const importedContent = `foo()`; + + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/d/f0.ts", rootContent1); + host.vfs.addFile("/a/f1.ts", importedContent); + + const fileExists = host.fileExists; + const watch = createWatchModeWithoutConfigFile(["/a/d/f0.ts"], host, { module: ModuleKind.AMD }); + + // ensure that imported file was found + checkOutputErrors(host, [ + createFileIsNotAModuleDiagnostic(watch(), "/a/d/f0.ts", rootContent1, "f1", "/a/f1.ts"), + createCannotFindNameDiagnostic(watch(), "/a/f1.ts", importedContent, "foo") + ], /*isInitial*/ true); + + // spy on calls to fileExists to make sure that disk is not touched + const fileExistsSpy1 = new Spy(fileExists); + host.fileExists = fileExistsSpy1.value; + + // write file and trigger synchronization + const rootContent2 = `import {x} from "f1"\nvar x: string = 1;`; + host.vfs.writeFile("/a/d/f0.ts", rootContent2); host.runQueuedTimeoutCallbacks(); + // verify fileExists was not called. + fileExistsSpy1.verify(_ => _(Arg.any()), Times.none()); + // ensure file has correct number of errors after edit checkOutputErrors(host, [ - f1IsNotModule, - getDiagnosticOfFileFromProgram(watch(), root.path, newContent.indexOf("var x") + "var ".length, "x".length, Diagnostics.Type_0_is_not_assignable_to_type_1, 1, "string"), - cannotFindFoo + createFileIsNotAModuleDiagnostic(watch(), "/a/d/f0.ts", rootContent1, "f1", "/a/f1.ts"), + createFileDiagnostic(getFile(watch(), "/a/d/f0.ts"), rootContent2.indexOf("var x") + "var ".length, "x".length, Diagnostics.Type_0_is_not_assignable_to_type_1, "1", "string"), + createCannotFindNameDiagnostic(watch(), "/a/f1.ts", importedContent, "foo") ]); - } - { - let fileExistsIsCalled = false; - host.fileExists = (fileName): boolean => { - if (fileName === "lib.d.ts") { - return false; - } - fileExistsIsCalled = true; - assert.isTrue(fileName.indexOf("/f2.") !== -1); - return originalFileExists.call(host, fileName); - }; - root.content = `import {x} from "f2"`; - host.reloadFS(files); + // spy on calls to fileExists to make sure LSHost only searches for 'f2' + const fileExistsSpy2 = new Spy(fileExists); + host.fileExists = fileExistsSpy2.value; - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + // write file and trigger synchronization + const rootContent3 = `import {x} from "f2"`; + host.vfs.writeFile("/a/d/f0.ts", rootContent3); host.runQueuedTimeoutCallbacks(); + // verify fileExists was called correctly + fileExistsSpy2 + .verify(_ => _(Arg.includes("/f2.")), Times.atLeastOnce()) + .verify(_ => _(Arg.not(Arg.includes("/f2."))), Times.none()); + // ensure file has correct number of errors after edit checkOutputErrors(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "f2") + createCannotFindModuleDiagnostic(watch(), "/a/d/f0.ts", rootContent3, "f2") ]); - assert.isTrue(fileExistsIsCalled); - } - { - let fileExistsCalled = false; - host.fileExists = (fileName): boolean => { - if (fileName === "lib.d.ts") { - return false; - } - fileExistsCalled = true; - assert.isTrue(fileName.indexOf("/f1.") !== -1); - return originalFileExists.call(host, fileName); - }; + // spy on calls to fileExists to make sure LSHost only searches for 'f1' + const fileExistsSpy3 = new Spy(fileExists); + host.fileExists = fileExistsSpy3.value; + + // write file and trigger synchronization + const rootContent4 = `import {x} from "f1"`; + host.vfs.writeFile("/a/d/f0.ts", rootContent4); + host.runQueuedTimeoutCallbacks(); + + // verify fileExists was called correctly + fileExistsSpy3 + .verify(_ => _(Arg.includes("/f1.")), Times.atLeastOnce()) + .verify(_ => _(Arg.not(Arg.includes("/f1."))), Times.none()); + + checkOutputErrors(host, [ + createFileIsNotAModuleDiagnostic(watch(), "/a/d/f0.ts", rootContent1, "f1", "/a/f1.ts"), + createCannotFindNameDiagnostic(watch(), "/a/f1.ts", importedContent, "foo") + ]); + }); + + it("loads missing files from disk", () => { + const rootContent1 = `import {x} from "bar"`; + + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/foo.ts", rootContent1); + + const fileExists = host.fileExists; + + // spy on calls to fileExists when starting watch mode + const fileExistsSpy1 = new Spy(fileExists); + host.fileExists = fileExistsSpy1.value; - const newContent = `import {x} from "f1"`; - root.content = newContent; + const watch = createWatchModeWithoutConfigFile(["/a/foo.ts"], host, { module: ModuleKind.AMD }); - host.reloadFS(files); + // verify fileExists was called correctly + fileExistsSpy1.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); + + checkOutputErrors(host, [ + createCannotFindModuleDiagnostic(watch(), "/a/foo.ts", rootContent1, "bar") + ], /*isInitial*/ true); + + // spy on calls to fileExists after synchronization is triggered + const fileExistsSpy2 = new Spy(fileExists); + host.fileExists = fileExistsSpy2.value; + + host.vfs.writeFile("/a/foo.ts", `import {y} from "bar"`); + host.vfs.writeFile("/a/bar.d.ts", `export const y = 1;`); host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, [f1IsNotModule, cannotFindFoo]); - assert.isTrue(fileExistsCalled); - } - }); + // verify fileExists was called correctly + fileExistsSpy2.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); - it("loads missing files from disk", () => { - const root = { - path: `/a/foo.ts`, - content: `import {x} from "bar"` - }; - - const imported = { - path: `/a/bar.d.ts`, - content: `export const y = 1;` - }; - - const files = [root, libFile]; - const host = createWatchedSystem(files); - const originalFileExists = host.fileExists; - - let fileExistsCalledForBar = false; - host.fileExists = fileName => { - if (fileName === "lib.d.ts") { - return false; - } - if (!fileExistsCalledForBar) { - fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; - } + checkOutputErrors(host, emptyArray); + }); - return originalFileExists.call(host, fileName); - }; + it("should compile correctly when resolved module goes missing and then comes back (module is not part of the root)", () => { + const rootContent = `import {x} from "bar"`; + const importedContent = `export const y = 1;export const x = 10;`; - const watch = createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/foo.ts", rootContent); + host.vfs.addFile("/a/bar.d.ts", importedContent); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); - checkOutputErrors(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") - ], /*isInitial*/ true); + const fileExists = host.fileExists; - fileExistsCalledForBar = false; - root.content = `import {y} from "bar"`; - host.reloadFS(files.concat(imported)); + // spy on fileExists when starting watch mode + const fileExistsSpy1 = new Spy(fileExists); + host.fileExists = fileExistsSpy1.value; - host.runQueuedTimeoutCallbacks(); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - checkOutputErrors(host, emptyArray); - }); + const watch = createWatchModeWithoutConfigFile(["/a/foo.ts"], host, { module: ModuleKind.AMD }); - it("should compile correctly when resolved module goes missing and then comes back (module is not part of the root)", () => { - const root = { - path: `/a/foo.ts`, - content: `import {x} from "bar"` - }; - - const imported = { - path: `/a/bar.d.ts`, - content: `export const y = 1;export const x = 10;` - }; - - const files = [root, libFile]; - const filesWithImported = files.concat(imported); - const host = createWatchedSystem(filesWithImported); - const originalFileExists = host.fileExists; - let fileExistsCalledForBar = false; - host.fileExists = fileName => { - if (fileName === "lib.d.ts") { - return false; - } - if (!fileExistsCalledForBar) { - fileExistsCalledForBar = fileName.indexOf("/bar.") !== -1; - } - return originalFileExists.call(host, fileName); - }; - - const watch = createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); - - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); - checkOutputErrors(host, emptyArray, /*isInitial*/ true); - - fileExistsCalledForBar = false; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - checkOutputErrors(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") - ]); - - fileExistsCalledForBar = false; - host.reloadFS(filesWithImported); - host.checkTimeoutQueueLengthAndRun(1); - assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - checkOutputErrors(host, emptyArray); - }); + // verify fileExists was called correctly + fileExistsSpy1.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); - it("works when module resolution changes to ambient module", () => { - const root = { - path: "/a/b/foo.ts", - content: `import * as fs from "fs";` - }; - - const packageJson = { - path: "/a/b/node_modules/@types/node/package.json", - content: ` -{ - "main": "" -} -` - }; - - const nodeType = { - path: "/a/b/node_modules/@types/node/index.d.ts", - content: ` -declare module "fs" { - export interface Stats { - isFile(): boolean; - } -}` - }; + checkOutputErrors(host, emptyArray, /*isInitial*/ true); - const files = [root, libFile]; - const filesWithNodeType = files.concat(packageJson, nodeType); - const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); + // spy on fileExists when triggering synchronization + const fileExistsSpy2 = new Spy(fileExists); + host.fileExists = fileExistsSpy2.value; - const watch = createWatchModeWithoutConfigFile([root.path], host, { }); + host.vfs.removeFile("/a/bar.d.ts"); + host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") - ], /*isInitial*/ true); + // verify fileExists was called correctly + fileExistsSpy2.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); - host.reloadFS(filesWithNodeType); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, emptyArray); - }); + checkOutputErrors(host, [ + createCannotFindModuleDiagnostic(watch(), "/a/foo.ts", rootContent, "bar") + ]); - it("works when included file with ambient module changes", () => { - const root = { - path: "/a/b/foo.ts", - content: ` -import * as fs from "fs"; -import * as u from "url"; -` - }; - - const file = { - path: "/a/b/bar.d.ts", - content: ` -declare module "url" { - export interface Url { - href?: string; - } -} -` - }; + // spy on fileExists when triggering synchronization + const fileExistsSpy3 = new Spy(fileExists); + host.fileExists = fileExistsSpy3.value; - const fileContentWithFS = ` -declare module "fs" { - export interface Stats { - isFile(): boolean; - } -} -`; + host.vfs.writeFile("/a/bar.d.ts", importedContent);; + host.checkTimeoutQueueLengthAndRun(1); - const files = [root, file, libFile]; - const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); + // verify fileExists was called correctly. + fileExistsSpy3.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); - const watch = createWatchModeWithoutConfigFile([root.path, file.path], host, {}); + checkOutputErrors(host, emptyArray); + }); - checkOutputErrors(host, [ - getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") - ], /*isInitial*/ true); + it("works when module resolution changes to ambient module", () => { + const rootContent = `import * as fs from "fs";`; + const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/b" }, lib: true }); + host.vfs.addFile("/a/b/foo.ts", rootContent); - file.content += fileContentWithFS; - host.reloadFS(files); - host.runQueuedTimeoutCallbacks(); - checkOutputErrors(host, emptyArray); - }); + const watch = createWatchModeWithoutConfigFile(["/a/b/foo.ts"], host, { }); + + checkOutputErrors(host, [ + createCannotFindModuleDiagnostic(watch(), "/a/b/foo.ts", rootContent, "fs") + ], /*isInitial*/ true); + + host.vfs.writeFile("/a/b/node_modules/@types/node/package.json", `{\n "main": ""\n}\n`); + host.vfs.writeFile("/a/b/node_modules/@types/node/index.d.ts", `\ndeclare module "fs" {\n export interface Stats {\n isFile(): boolean;\n }\n}`); + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, emptyArray); + }); + + it("works when included file with ambient module changes", () => { + const rootContent = `import * as fs from "fs";\nimport * as u from "url";`; + const fileContent1 = `declare module "url" {\n export interface Url {\n href?: string;\n }\n}`; + + const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/b" }, lib: true }); + host.vfs.addFile("/a/b/foo.ts", rootContent); + host.vfs.addFile("/a/b/bar.d.ts", fileContent1); + + const watch = createWatchModeWithoutConfigFile(["/a/b/foo.ts", "/a/b/bar.d.ts"], host, {}); + + checkOutputErrors(host, [ + createCannotFindModuleDiagnostic(watch(), "/a/b/foo.ts", rootContent, "fs") + ], /*isInitial*/ true); - it("works when reusing program with files from external library", () => { - interface ExpectedFile { path: string; isExpectedToEmit?: boolean; content?: string; } - const configDir = "/a/b/projects/myProject/src/"; - const file1: FileOrFolder = { - path: configDir + "file1.ts", - content: 'import module1 = require("module1");\nmodule1("hello");' - }; - const file2: FileOrFolder = { - path: configDir + "file2.ts", - content: 'import module11 = require("module1");\nmodule11("hello");' - }; - const module1: FileOrFolder = { - path: "/a/b/projects/myProject/node_modules/module1/index.js", - content: "module.exports = options => { return options.toString(); }" - }; - const configFile: FileOrFolder = { - path: configDir + "tsconfig.json", - content: JSON.stringify({ + const fileContent2 = fileContent1 + `declare module "fs" {\n export interface Stats {\n isFile(): boolean;\n }\n}`; + host.vfs.writeFile("/a/b/bar.d.ts", fileContent2); + host.runQueuedTimeoutCallbacks(); + checkOutputErrors(host, emptyArray); + }); + + it("works when reusing program with files from external library", () => { + const file1Content = `import module1 = require("module1");\nmodule1("hello");`; + const file1Output = `"use strict";\nexports.__esModule = true;\nvar module1 = require("module1");\nmodule1("hello");\n`; + const file2Content = `import module11 = require("module1");\nmodule11("hello");`; + const file2Output = `"use strict";\nexports.__esModule = true;\nvar module11 = require("module1");\nmodule11("hello");\n`; + + const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/b/projects/myProject/" }, lib: true }); + host.vfs.addFile("/a/b/projects/myProject/src/file1.ts", file1Content); + host.vfs.addFile("/a/b/projects/myProject/src/file2.ts", file2Content); + host.vfs.addFile("/a/b/projects/myProject/node_modules/module1/index.js", `module.exports = options => { return options.toString(); }`); + host.vfs.addFile("/a/b/projects/myProject/src/tsconfig.json", JSON.stringify({ compilerOptions: { allowJs: true, rootDir: ".", @@ -1932,67 +1380,67 @@ declare module "fs" { moduleResolution: "node", maxNodeModuleJsDepth: 1 } - }) - }; - const outDirFolder = "/a/b/projects/myProject/dist/"; - const programFiles = [file1, file2, module1, libFile]; - const host = createWatchedSystem(programFiles.concat(configFile), { currentDirectory: "/a/b/projects/myProject/" }); - const watch = createWatchModeWithConfigFile(configFile.path, host); - checkProgramActualFiles(watch(), programFiles.map(f => f.path)); - checkOutputErrors(host, emptyArray, /*isInitial*/ true); - const expectedFiles: ExpectedFile[] = [ - createExpectedEmittedFile(file1), - createExpectedEmittedFile(file2), - createExpectedToNotEmitFile("index.js"), - createExpectedToNotEmitFile("src/index.js"), - createExpectedToNotEmitFile("src/file1.js"), - createExpectedToNotEmitFile("src/file2.js"), - createExpectedToNotEmitFile("lib.js"), - createExpectedToNotEmitFile("lib.d.ts") - ]; - verifyExpectedFiles(expectedFiles); - - file1.content += "\n;"; - expectedFiles[0].content += ";\n"; // Only emit file1 with this change - expectedFiles[1].isExpectedToEmit = false; - host.reloadFS(programFiles.concat(configFile)); - host.runQueuedTimeoutCallbacks(); - checkProgramActualFiles(watch(), programFiles.map(f => f.path)); - checkOutputErrors(host, emptyArray); - verifyExpectedFiles(expectedFiles); - - - function verifyExpectedFiles(expectedFiles: ExpectedFile[]) { - forEach(expectedFiles, f => { - assert.equal(!!host.fileExists(f.path), f.isExpectedToEmit, "File " + f.path + " is expected to " + (f.isExpectedToEmit ? "emit" : "not emit")); - if (f.isExpectedToEmit) { - assert.equal(host.readFile(f.path), f.content, "Expected contents of " + f.path); - } - }); - } + })); - function createExpectedToNotEmitFile(fileName: string): ExpectedFile { - return { - path: outDirFolder + fileName, - isExpectedToEmit: false - }; - } + const writeFile = host.writeFile; - function createExpectedEmittedFile(file: FileOrFolder): ExpectedFile { - return { - path: removeFileExtension(file.path.replace(configDir, outDirFolder)) + Extension.Js, - isExpectedToEmit: true, - content: '"use strict";\nexports.__esModule = true;\n' + file.content.replace("import", "var") + "\n" - }; - } + // spy on calls to writeFile when starting watch mode + const writeFileSpy1 = new Spy(writeFile); + host.writeFile = writeFileSpy1.value; + + const watch = createWatchModeWithConfigFile("/a/b/projects/myProject/src/tsconfig.json", host); + checkProgramActualFiles(watch(), [ + "/a/b/projects/myProject/src/file1.ts", + "/a/b/projects/myProject/src/file2.ts", + "/a/b/projects/myProject/node_modules/module1/index.js", + mocks.MockServerHost.libPath + ]); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); + + // verify writeFile was called correctly. + writeFileSpy1 + .verify(_ => _("/a/b/projects/myProject/dist/file1.js", file1Output, Arg.any()), Times.once()) + .verify(_ => _("/a/b/projects/myProject/dist/file2.js", file2Output, Arg.any()), Times.once()) + .verify(_ => _("/a/b/projects/myProject/dist/index.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/src/index.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/src/file1.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/src/file2.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/lib.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/lib.d.ts", Arg.string(), Arg.any()), Times.none()); + + // spy on calls to writeFile when triggering synchronization + const writeFileSpy2 = new Spy(writeFile); + host.writeFile = writeFileSpy2.value; + + host.vfs.writeFile("/a/b/projects/myProject/src/file1.ts", file1Content + "\n;"); + host.runQueuedTimeoutCallbacks(); + checkProgramActualFiles(watch(), [ + "/a/b/projects/myProject/src/file1.ts", + "/a/b/projects/myProject/src/file2.ts", + "/a/b/projects/myProject/node_modules/module1/index.js", + mocks.MockServerHost.libPath + ]); + checkOutputErrors(host, emptyArray); + + // verify writeFile was called correctly + writeFileSpy2 + .verify(_ => _("/a/b/projects/myProject/dist/file1.js", file1Output + ";\n", Arg.any()), Times.once()) + .verify(_ => _("/a/b/projects/myProject/dist/file2.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/index.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/src/index.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/src/file1.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/src/file2.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/lib.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/a/b/projects/myProject/dist/lib.d.ts", Arg.string(), Arg.any()), Times.none()); + }); }); - }); - describe("tsc-watch with when module emit is specified as node", () => { - it("when instead of filechanged recursive directory watcher is invoked", () => { - const configFile: FileOrFolder = { - path: "/a/rootFolder/project/tsconfig.json", - content: JSON.stringify({ + describe("with when module emit is specified as node", () => { + it("when instead of filechanged recursive directory watcher is invoked", () => { + const host = new mocks.MockServerHost({ lib: true }); + host.vfs.addFile("/a/rootFolder/project/Scripts/TypeScript.ts", `var z = 10;`); + host.vfs.addFile("/a/rootFolder/project/Scripts/Javascript.js", `var zz = 10;`); + host.vfs.addFile("/a/rootFolder/project/tsconfig.json", JSON.stringify({ compilerOptions: { module: "none", allowJs: true, @@ -2001,30 +1449,36 @@ declare module "fs" { include: [ "Scripts/**/*" ], - }) - }; - const outputFolder = "/a/rootFolder/project/Static/scripts/"; - const file1: FileOrFolder = { - path: "/a/rootFolder/project/Scripts/TypeScript.ts", - content: "var z = 10;" - }; - const file2: FileOrFolder = { - path: "/a/rootFolder/project/Scripts/Javascript.js", - content: "var zz = 10;" - }; - const files = [configFile, file1, file2, libFile]; - const host = createWatchedSystem(files); - const watch = createWatchModeWithConfigFile(configFile.path, host); - - checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path)); - file1.content = "var zz30 = 100;"; - host.reloadFS(files, { invokeDirectoryWatcherInsteadOfFileChanged: true }); - host.runQueuedTimeoutCallbacks(); - - checkProgramActualFiles(watch(), mapDefined(files, f => f === configFile ? undefined : f.path)); - const outputFile1 = changeExtension((outputFolder + getBaseFileName(file1.path)), ".js"); - assert.isTrue(host.fileExists(outputFile1)); - assert.equal(host.readFile(outputFile1), file1.content + host.newLine); + })); + + const writeFile = host.writeFile; + const watch = createWatchModeWithConfigFile("/a/rootFolder/project/tsconfig.json", host); + + checkProgramActualFiles(watch(), [ + "/a/rootFolder/project/Scripts/TypeScript.ts", + "/a/rootFolder/project/Scripts/Javascript.js", + mocks.MockServerHost.libPath + ]); + + + host.vfs.watchFiles = false; + host.vfs.removeFile("/a/rootFolder/project/Scripts/TypeScript.ts"); + host.runQueuedTimeoutCallbacks(); + + const writeFileSpy1 = new Spy(writeFile); + host.writeFile = writeFileSpy1.value; + + host.vfs.writeFile("/a/rootFolder/project/Scripts/TypeScript.ts", `var zz30 = 100;`); + host.runQueuedTimeoutCallbacks(); + + checkProgramActualFiles(watch(), [ + "/a/rootFolder/project/Scripts/TypeScript.ts", + "/a/rootFolder/project/Scripts/Javascript.js", + mocks.MockServerHost.libPath + ]); + + writeFileSpy1.verify(_ => _("/a/rootFolder/project/Static/scripts/TypeScript.js", `var zz30 = 100;\n`, Arg.any()), Times.once()); + }); }); }); } diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index ea573726eb8c4..0ef61c1317d24 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -401,9 +401,9 @@ namespace ts.projectSystem { } } - export function makeSessionRequest(command: string, args: T) { + export function makeSessionRequest(command: string, args: T, seq = 0) { const newRequest: protocol.Request = { - seq: 0, + seq, type: "request", command, arguments: args @@ -411,9 +411,29 @@ namespace ts.projectSystem { return newRequest; } - export function openFilesForSession(files: FileOrFolder[], session: server.Session) { + export function sendOpenRequest(session: server.Session, args: server.protocol.OpenRequestArgs, seq?: number) { + session.executeCommand(makeSessionRequest(CommandNames.Open, args, seq)); + } + + export function sendChangeRequest(session: server.Session, args: server.protocol.ChangeRequestArgs, seq?: number) { + session.executeCommand(makeSessionRequest(CommandNames.Change, args, seq)); + } + + export function sendCompileOnSaveAffectedFileListRequest(session: server.Session, args: server.protocol.FileRequestArgs, seq?: number) { + return session.executeCommand(makeSessionRequest(CommandNames.CompileOnSaveAffectedFileList, args, seq)).response as server.protocol.CompileOnSaveAffectedFileListSingleProject[]; + } + + export function sendCompileOnSaveEmitFileRequest(session: server.Session, args: server.protocol.CompileOnSaveEmitFileRequestArgs, seq?: number) { + session.executeCommand(makeSessionRequest(CommandNames.CompileOnSaveEmitFile, args, seq)); + } + + export function sendCompilerOptionsDiagnosticsRequest(session: server.Session, args: server.protocol.CompilerOptionsDiagnosticsRequestArgs, seq?: number) { + return session.executeCommand(makeSessionRequest(CommandNames.CompilerOptionsDiagnosticsFull, args, seq)).response as server.protocol.DiagnosticWithLinePosition[]; + } + + export function openFilesForSession(files: (string | FileOrFolder | vfs.VirtualFile)[], session: server.Session) { for (const file of files) { - const request = makeSessionRequest(CommandNames.Open, { file: file.path }); + const request = makeSessionRequest(CommandNames.Open, { file: typeof file === "string" ? file : file.path }); session.executeCommand(request); } } diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index e321fb1c99ddc..2d9a86607fad5 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -1,6 +1,9 @@ /// /// /// +/// +/// +/// namespace ts.projectSystem { import TI = server.typingsInstaller; @@ -37,10 +40,20 @@ namespace ts.projectSystem { } } - function executeCommand(self: Installer, host: TestServerHost, installedTypings: string[] | string, typingFiles: FileOrFolder[], cb: TI.RequestCompletedAction): void { + function executeCommand(self: Installer, host: TestServerHost | mocks.MockServerHost, installedTypings: string[] | string, typingFiles: FileOrFolder[], cb: TI.RequestCompletedAction): void { self.addPostExecAction(installedTypings, success => { for (const file of typingFiles) { - host.ensureFileOrFolder(file); + if (host instanceof mocks.MockServerHost) { + if (typeof file.content === "string") { + host.vfs.addFile(file.path, file.content, { overwrite: true }); + } + else { + host.vfs.addDirectory(file.path); + } + } + else { + host.ensureFileOrFolder(file); + } } cb(success); }); @@ -62,35 +75,22 @@ namespace ts.projectSystem { describe("local module", () => { it("should not be picked up", () => { - const f1 = { - path: "/a/app.js", - content: "const c = require('./config');" - }; - const f2 = { - path: "/a/config.js", - content: "export let x = 1" - }; - const typesCache = "/cache"; - const typesConfig = { - path: typesCache + "/node_modules/@types/config/index.d.ts", - content: "export let y: number;" - }; - const config = { - path: "/a/jsconfig.json", - content: JSON.stringify({ - compilerOptions: { moduleResolution: "commonjs" }, - typeAcquisition: { enable: true } - }) - }; - const host = createServerHost([f1, f2, config, typesConfig]); - const installer = new (class extends Installer { + const host = new mocks.MockServerHost(); + const f1 = host.vfs.addFile("/a/app.js", `const c = require('./config');`); + const f2 = host.vfs.addFile("/a/config.js", `export let x = 1`); + const config = host.vfs.addFile("/a/jsconfig.json", `{ "typeAcquisition": { "enable": true }, "compilerOptions": { "moduleResolution": "commonjs } }`); + host.vfs.addFile("/cache/node_modules/@types/config/index.d.ts", `export let y: number;`); + + const installer = new class extends Installer { constructor() { - super(host, { typesRegistry: createTypesRegistry("config"), globalTypingsCacheLocation: typesCache }); + super(host, { typesRegistry: createTypesRegistry("config"), globalTypingsCacheLocation: "/cache" }); } + installWorker(_requestId: number, _args: string[], _cwd: string, _cb: TI.RequestCompletedAction) { assert(false, "should not be called"); } - })(); + }; + const service = createProjectService(host, { typingsInstaller: installer }); service.openClientFile(f1.path); service.checkNumberOfProjects({ configuredProjects: 1 }); @@ -101,46 +101,27 @@ namespace ts.projectSystem { describe("typingsInstaller", () => { it("configured projects (typings installed) 1", () => { - const file1 = { - path: "/a/b/app.js", - content: "" - }; - const tsconfig = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { - allowJs: true - }, - typeAcquisition: { - enable: true - } - }) - }; - const packageJson = { - path: "/a/b/package.json", - content: JSON.stringify({ - name: "test", - dependencies: { - jquery: "^3.1.0" - } - }) - }; - const jquery = { path: "/a/data/node_modules/@types/jquery/index.d.ts", content: "declare const $: { x: number }" }; - const host = createServerHost([file1, tsconfig, packageJson]); - const installer = new (class extends Installer { + + const host = new mocks.MockServerHost({ safeList: true }); + const file1 = host.vfs.addFile("/a/b/app.js", ``); + const tsconfig = host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": { "allowJs": true }, "typeAcquisition": { "enable": true } }`); + host.vfs.addFile("/a/b/package.json", `{ "name": "test", "dependencies": { "jquery": "^3.1.0" } }`); + + 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); @@ -157,35 +138,26 @@ namespace ts.projectSystem { }); it("inferred project (typings installed)", () => { - 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 jquery = { path: "/a/data/node_modules/@types/jquery/index.d.ts", content: "declare const $: { x: number }" }; - const host = createServerHost([file1, packageJson]); - const installer = new (class extends Installer { + + const host = new mocks.MockServerHost({ safeList: true }); + const file1 = host.vfs.addFile("/a/b/app.js", ``); + host.vfs.addFile("/a/b/package.json", `{ "name": "test", "dependencies": { "jquery": "^3.1.0" } }`); + + 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); @@ -201,19 +173,18 @@ namespace ts.projectSystem { }); it("external project - no type acquisition, no .d.ts/js files", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; - const host = createServerHost([file1]); - const installer = new (class extends Installer { + const host = new mocks.MockServerHost({ safeList: true }); + const file1 = host.vfs.addFile("/a/b/app.ts", ``); + + const installer = new class extends Installer { constructor() { super(host); } + enqueueInstallTypingsRequest() { assert(false, "auto discovery should not be enabled"); } - })(); + }; const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -222,6 +193,7 @@ namespace ts.projectSystem { options: {}, rootFiles: [toExternalFile(file1.path)] }); + installer.checkPendingCommands(/*expectedCount*/ 0); // by default auto discovery will kick in if project contain only .js/.d.ts files // in this case project contain only ts files - no auto discovery @@ -229,19 +201,16 @@ namespace ts.projectSystem { }); it("external project - no auto in typing acquisition, no .d.ts/js files", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; - const host = createServerHost([file1]); - const installer = new (class extends Installer { + const host = new mocks.MockServerHost({ safeList: true }); + const file1 = host.vfs.addFile("/a/b/app.ts", ``); + const installer = new class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("jquery") }); } enqueueInstallTypingsRequest() { assert(false, "auto discovery should not be enabled"); } - })(); + }; const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -258,17 +227,16 @@ namespace ts.projectSystem { }); it("external project - autoDiscovery = true, no .d.ts/js files", () => { - const file1 = { - path: "/a/b/app.ts", - content: "" - }; + const host = new mocks.MockServerHost({ safeList: true }); + const file1 = host.vfs.addFile("/a/b/app.ts", ``); + const jquery = { path: "/a/data/node_modules/@types/jquery/index.d.ts", content: "declare const $: { x: number }" }; - const host = createServerHost([file1]); + let enqueueIsCalled = false; - const installer: Installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("jquery") }); } @@ -281,7 +249,7 @@ namespace ts.projectSystem { const typingFiles = [jquery]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -304,18 +272,12 @@ namespace ts.projectSystem { // 1. react typings are installed for .jsx // 2. loose files names are matched against safe list for typings if // this is a JS project (only js, jsx, d.ts files are present) - const file1 = { - path: "/a/b/lodash.js", - content: "" - }; - const file2 = { - path: "/a/b/file2.jsx", - content: "" - }; - const file3 = { - path: "/a/b/file3.d.ts", - content: "" - }; + const host = new mocks.MockServerHost({ safeList: true }); + const file1 = host.vfs.addFile("/a/b/lodash.js", ``); + const file2 = host.vfs.addFile("/a/b/file2.jsx", ``); + const file3 = host.vfs.addFile("/a/b/file3.d.ts", ``); + host.vfs.addFile(customTypesMap.path, customTypesMap.content); + const react = { path: "/a/data/node_modules/@types/react/index.d.ts", content: "declare const react: { x: number }" @@ -325,8 +287,7 @@ namespace ts.projectSystem { content: "declare const lodash: { x: number }" }; - const host = createServerHost([file1, file2, file3, customTypesMap]); - const installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("lodash", "react") }); } @@ -335,7 +296,7 @@ namespace ts.projectSystem { const typingFiles = [lodash, react]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -361,17 +322,11 @@ namespace ts.projectSystem { it("external project - no type acquisition, with js & ts files", () => { // Tests: // 1. No typings are included for JS projects when the project contains ts files - const file1 = { - path: "/a/b/jquery.js", - content: "" - }; - const file2 = { - path: "/a/b/file2.ts", - content: "" - }; + const host = new mocks.MockServerHost({ safeList: true }); + const file1 = host.vfs.addFile("/a/b/jquery.js", ``); + const file2 = host.vfs.addFile("/a/b/file2.ts", ``); - const host = createServerHost([file1, file2]); - const installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("jquery") }); } @@ -383,7 +338,7 @@ namespace ts.projectSystem { const typingFiles: FileOrFolder[] = []; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -409,27 +364,12 @@ namespace ts.projectSystem { // 1. Safelist matching, type acquisition includes/excludes and package.json typings are all acquired // 2. Types for safelist matches are not included when they also appear in the type acquisition exclude list // 3. Multiple includes and excludes are respected in type acquisition - const file1 = { - path: "/a/b/lodash.js", - content: "" - }; - const file2 = { - path: "/a/b/commander.js", - content: "" - }; - const file3 = { - path: "/a/b/file3.d.ts", - content: "" - }; - const packageJson = { - path: "/a/b/package.json", - content: JSON.stringify({ - name: "test", - dependencies: { - express: "^3.1.0" - } - }) - }; + const host = new mocks.MockServerHost({ safeList: true }); + const file1 = host.vfs.addFile("/a/b/lodash.js", ``); + const file2 = host.vfs.addFile("/a/b/commander.js", ``); + const file3 = host.vfs.addFile("/a/b/file3.d.ts", ``); + host.vfs.addFile("/a/b/package.json", `{ "name": "test", "dependencies": { "express": "^3.1.0" } }`); + host.vfs.addFile(customTypesMap.path, customTypesMap.content); const commander = { path: "/a/data/node_modules/@types/commander/index.d.ts", @@ -448,8 +388,7 @@ namespace ts.projectSystem { content: "declare const moment: { x: number }" }; - const host = createServerHost([file1, file2, file3, packageJson, customTypesMap]); - const installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { typesRegistry: createTypesRegistry("jquery", "commander", "moment", "express") }); } @@ -458,7 +397,7 @@ namespace ts.projectSystem { const typingFiles = [commander, express, jquery, moment]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -482,27 +421,12 @@ namespace ts.projectSystem { }); it("Throttle - delayed typings to install", () => { - const lodashJs = { - path: "/a/b/lodash.js", - content: "" - }; - const commanderJs = { - path: "/a/b/commander.js", - content: "" - }; - const file3 = { - path: "/a/b/file3.d.ts", - content: "" - }; - const packageJson = { - path: "/a/b/package.json", - content: JSON.stringify({ - name: "test", - dependencies: { - express: "^3.1.0" - } - }) - }; + const host = new mocks.MockServerHost({ safeList: true }); + const lodashJs = host.vfs.addFile("/a/b/lodash.js", ``); + const commanderJs = host.vfs.addFile("/a/b/commander.js", ``); + const file3 = host.vfs.addFile("/a/b/file3.d.ts", ``); + host.vfs.addFile("/a/b/package.json", `{ "name": "test", "dependencies": { "express": "^3.1.0" } }`); + host.vfs.addFile(customTypesMap.path, customTypesMap.content); const commander = { path: "/a/data/node_modules/@types/commander/index.d.ts", @@ -526,8 +450,7 @@ namespace ts.projectSystem { }; const typingFiles = [commander, express, jquery, moment, lodash]; - const host = createServerHost([lodashJs, commanderJs, file3, packageJson, customTypesMap]); - const installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { throttleLimit: 3, typesRegistry: createTypesRegistry("commander", "express", "jquery", "moment", "lodash") }); } @@ -535,7 +458,7 @@ namespace ts.projectSystem { const installedTypings = ["@types/commander", "@types/express", "@types/jquery", "@types/moment", "@types/lodash"]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -561,18 +484,11 @@ namespace ts.projectSystem { }); it("Throttle - delayed run install requests", () => { - const lodashJs = { - path: "/a/b/lodash.js", - content: "" - }; - const commanderJs = { - path: "/a/b/commander.js", - content: "" - }; - const file3 = { - path: "/a/b/file3.d.ts", - content: "" - }; + const host = new mocks.MockServerHost({ safeList: true }); + const lodashJs = host.vfs.addFile("/a/b/lodash.js", ``); + const commanderJs = host.vfs.addFile("/a/b/commander.js", ``); + const file3 = host.vfs.addFile("/a/b/file3.d.ts", ``); + host.vfs.addFile(customTypesMap.path, customTypesMap.content); const commander = { path: "/a/data/node_modules/@types/commander/index.d.ts", @@ -605,8 +521,7 @@ namespace ts.projectSystem { typings: typingsName("gulp") }; - const host = createServerHost([lodashJs, commanderJs, file3, customTypesMap]); - const installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { throttleLimit: 1, typesRegistry: createTypesRegistry("commander", "jquery", "lodash", "cordova", "gulp", "grunt") }); } @@ -620,7 +535,7 @@ namespace ts.projectSystem { } executeCommand(this, host, typingFiles.map(f => f.typings), typingFiles, cb); } - })(); + }; // Create project #1 with 4 typings const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -658,39 +573,25 @@ namespace ts.projectSystem { assert.equal(installer.pendingRunRequests.length, 0, "expected no throttled requests"); installer.executePendingCommands(); - host.checkTimeoutQueueLengthAndRun(3); // for 2 projects and 1 refreshing inferred project + host.checkTimeoutQueueLengthAndRun(3); checkProjectActualFiles(p1, [lodashJs.path, commanderJs.path, file3.path, commander.path, jquery.path, lodash.path, cordova.path]); checkProjectActualFiles(p2, [file3.path, grunt.path, gulp.path]); }); it("configured projects discover from node_modules", () => { - const app = { - path: "/app.js", - content: "" - }; - const jsconfig = { - path: "/jsconfig.json", - content: JSON.stringify({}) - }; - const jquery = { - path: "/node_modules/jquery/index.js", - content: "" - }; - const jqueryPackage = { - path: "/node_modules/jquery/package.json", - content: JSON.stringify({ name: "jquery" }) - }; - // Should not search deeply in node_modules. - const nestedPackage = { - path: "/node_modules/jquery/nested/package.json", - content: JSON.stringify({ name: "nested" }), - }; const jqueryDTS = { path: "/tmp/node_modules/@types/jquery/index.d.ts", content: "" }; - const host = createServerHost([app, jsconfig, jquery, jqueryPackage, nestedPackage]); - const installer = new (class extends Installer { + const host = new mocks.MockServerHost({ safeList: true }); + const app = host.vfs.addFile("/app.js", ``); + const jsconfig = host.vfs.addFile("/jsconfig.json", `{}`); + host.vfs.addFile("/node_modules/jquery/index.js", ``); + host.vfs.addFile("/node_modules/jquery/package.json", `{ "name": "jquery" }`); + // Should not search deeply in node_modules. + host.vfs.addFile("/node_modules/jquery/nested/package.json", `{ "name": "nested" }`); + + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery", "nested") }); } @@ -700,7 +601,7 @@ namespace ts.projectSystem { const typingFiles = [jqueryDTS]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); projectService.openClientFile(app.path); @@ -717,28 +618,18 @@ namespace ts.projectSystem { }); it("configured projects discover from bower_components", () => { - const app = { - path: "/app.js", - content: "" - }; - const jsconfig = { - path: "/jsconfig.json", - content: JSON.stringify({}) - }; - const jquery = { - path: "/bower_components/jquery/index.js", - content: "" - }; - const jqueryPackage = { - path: "/bower_components/jquery/package.json", - content: JSON.stringify({ name: "jquery" }) - }; + const host = new mocks.MockServerHost({ safeList: true }); + const app = host.vfs.addFile("/app.js", ``); + const jsconfig = host.vfs.addFile("/jsconfig.json", `{}`); + host.vfs.addFile("/bower_components/jquery/index.js", ``); + host.vfs.addFile("/bower_components/jquery/package.json", `{ "name": "jquery" }`); + const jqueryDTS = { path: "/tmp/node_modules/@types/jquery/index.d.ts", content: "" }; - const host = createServerHost([app, jsconfig, jquery, jqueryPackage]); - const installer = new (class extends Installer { + + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery") }); } @@ -747,7 +638,7 @@ namespace ts.projectSystem { const typingFiles = [jqueryDTS]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); projectService.openClientFile(app.path); @@ -755,7 +646,7 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { configuredProjects: 1 }); const p = configuredProjectAt(projectService, 0); checkProjectActualFiles(p, [app.path, jsconfig.path]); - checkWatchedFiles(host, [jsconfig.path, "/bower_components", "/node_modules", libFile.path]); + checkWatchedFiles(host, [jsconfig.path, "/bower_components", "/node_modules", "/.ts/lib.d.ts"]); installer.installAll(/*expectedCount*/ 1); @@ -765,28 +656,17 @@ namespace ts.projectSystem { }); it("configured projects discover from bower.json", () => { - const app = { - path: "/app.js", - content: "" - }; - const jsconfig = { - path: "/jsconfig.json", - content: JSON.stringify({}) - }; - const bowerJson = { - path: "/bower.json", - content: JSON.stringify({ - dependencies: { - jquery: "^3.1.0" - } - }) - }; + const host = new mocks.MockServerHost({ safeList: true }); + const app = host.vfs.addFile("/app.js", ``); + const jsconfig = host.vfs.addFile("/jsconfig.json", `{}`); + host.vfs.addFile("/bower.json", `{ "dependencies": { "jquery": "^3.1.0" } }`); + const jqueryDTS = { path: "/tmp/node_modules/@types/jquery/index.d.ts", content: "" }; - const host = createServerHost([app, jsconfig, bowerJson]); - const installer = new (class extends Installer { + + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery") }); } @@ -795,7 +675,7 @@ namespace ts.projectSystem { const typingFiles = [jqueryDTS]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); projectService.openClientFile(app.path); @@ -812,25 +692,17 @@ namespace ts.projectSystem { }); it("Malformed package.json should be watched", () => { - const f = { - path: "/a/b/app.js", - content: "var x = 1" - }; - const brokenPackageJson = { - path: "/a/b/package.json", - content: `{ "dependencies": { "co } }` - }; - const fixedPackageJson = { - path: brokenPackageJson.path, - content: `{ "dependencies": { "commander": "0.0.2" } }` - }; + const host = new mocks.MockServerHost({ safeList: true }); + const f = host.vfs.addFile("/a/b/app.js", `var x = 1`); + host.vfs.addFile("/a/b/package.json", `{ "dependencies": { "co } }`); + const cachePath = "/a/cache/"; const commander = { path: cachePath + "node_modules/@types/commander/index.d.ts", content: "export let x: number" }; - const host = createServerHost([f, brokenPackageJson]); - const installer = new (class extends Installer { + + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); } @@ -839,28 +711,32 @@ namespace ts.projectSystem { const typingFiles = [commander]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; + const service = createProjectService(host, { typingsInstaller: installer }); service.openClientFile(f.path); installer.checkPendingCommands(/*expectedCount*/ 0); - host.reloadFS([f, fixedPackageJson]); + host.vfs.writeFile("/a/b/package.json", `{ "dependencies": { "commander": "0.0.2" } }`); + host.checkTimeoutQueueLengthAndRun(2); // To refresh the project and refresh inferred projects + // expected install request installer.installAll(/*expectedCount*/ 1); + host.checkTimeoutQueueLengthAndRun(2); + service.checkNumberOfProjects({ inferredProjects: 1 }); checkProjectActualFiles(service.inferredProjects[0], [f.path, commander.path]); }); it("should install typings for unresolved imports", () => { - const file = { - path: "/a/b/app.js", - content: ` - import * as fs from "fs"; - import * as commander from "commander";` - }; + const host = new mocks.MockServerHost({ safeList: true }); + const file = host.vfs.addFile("/a/b/app.js", + `import * as fs from "fs";\n` + + `import * as commander from "commander";`); + const cachePath = "/a/cache"; const node = { path: cachePath + "/node_modules/@types/node/index.d.ts", @@ -870,8 +746,8 @@ namespace ts.projectSystem { path: cachePath + "/node_modules/@types/commander/index.d.ts", content: "export let y: string" }; - const host = createServerHost([file]); - const installer = new (class extends Installer { + + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("node", "commander") }); } @@ -880,7 +756,8 @@ namespace ts.projectSystem { const typingFiles = [node, commander]; executeCommand(this, host, installedTypings, typingFiles, cb); } - })(); + }; + const service = createProjectService(host, { typingsInstaller: installer }); service.openClientFile(file.path); @@ -896,28 +773,25 @@ namespace ts.projectSystem { }); it("should pick typing names from non-relative unresolved imports", () => { - const f1 = { - path: "/a/b/app.js", - content: ` - import * as a from "foo/a/a"; - import * as b from "foo/a/b"; - import * as c from "foo/a/c"; - import * as d from "@bar/router/"; - import * as e from "@bar/common/shared"; - import * as e from "@bar/common/apps"; - import * as f from "./lib" - ` - }; - - const host = createServerHost([f1]); - const installer = new (class extends Installer { + const host = new mocks.MockServerHost({ safeList: true }); + const f1 = host.vfs.addFile("/a/b/app.js", + `import * as a from "foo/a/a";\n` + + `import * as b from "foo/a/b";\n` + + `import * as c from "foo/a/c";\n` + + `import * as d from "@bar/router/";\n` + + `import * as e from "@bar/common/shared";\n` + + `import * as e from "@bar/common/apps";\n` + + `import * as f from "./lib"`); + + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("foo") }); } installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { executeCommand(this, host, ["foo"], [], cb); } - })(); + }; + const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); projectService.checkNumberOfProjects({ inferredProjects: 1 }); @@ -934,7 +808,7 @@ namespace ts.projectSystem { }); it("cached unresolved typings are not recomputed if program structure did not change", () => { - const host = createServerHost([]); + const host = new mocks.MockServerHost({ safeList: true }); const session = createSession(host); const f = { path: "/a/app.js", @@ -1005,28 +879,20 @@ namespace ts.projectSystem { describe("Invalid package names", () => { it("should not be installed", () => { - const f1 = { - path: "/a/b/app.js", - content: "let x = 1" - }; - const packageJson = { - path: "/a/b/package.json", - content: JSON.stringify({ - dependencies: { - "; say ‘Hello from TypeScript!’ #": "0.0.x" - } - }) - }; + const host = new mocks.MockServerHost({ safeList: true }); + const f1 = host.vfs.addFile("/a/b/app.js", `let x = 1`); + host.vfs.addFile("/a/b/package.json", `{ "dependencies": { "; say ‘Hello from TypeScript!’ #": "0.0.x" } }`); + const messages: string[] = []; - const host = createServerHost([f1, packageJson]); - const installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: "/tmp" }, { isEnabled: () => true, writeLine: msg => messages.push(msg) }); } installWorker(_requestId: number, _args: string[], _cwd: string, _cb: TI.RequestCompletedAction) { assert(false, "runCommand should not be invoked"); } - })(); + }; + const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); @@ -1039,22 +905,14 @@ namespace ts.projectSystem { const emptySafeList = emptyMap; it("should use mappings from safe list", () => { - const app = { - path: "/a/b/app.js", - content: "" - }; - const jquery = { - path: "/a/b/jquery.js", - content: "" - }; - const chroma = { - path: "/a/b/chroma.min.js", - content: "" - }; + const host = new mocks.MockServerHost({ safeList: true }); + const app = host.vfs.addFile("/a/b/app.js", ``); + const jquery = host.vfs.addFile("/a/b/jquery.js", ``); + const chroma = host.vfs.addFile("/a/b/chroma.min.js", ``); const safeList = createMapFromTemplate({ jquery: "jquery", chroma: "chroma-js" }); - const host = createServerHost([app, jquery, chroma]); + // 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 finish = logger.finish(); @@ -1067,11 +925,9 @@ namespace ts.projectSystem { }); it("should return node for core modules", () => { - const f = { - path: "/a/b/app.js", - content: "" - }; - const host = createServerHost([f]); + const host = new mocks.MockServerHost({ safeList: true }); + const f = host.vfs.addFile("/a/b/app.js", ``); + const cache = createMap(); for (const name of JsTyping.nodeCoreModuleList) { @@ -1086,15 +942,10 @@ namespace ts.projectSystem { }); it("should use cached locations", () => { - const f = { - path: "/a/b/app.js", - content: "" - }; - const node = { - path: "/a/b/node.d.ts", - content: "" - }; - const host = createServerHost([f, node]); + const host = new mocks.MockServerHost({ safeList: true }); + const f = host.vfs.addFile("/a/b/app.js", ``); + const node = host.vfs.addFile("/a/b/node.d.ts", ``); + const cache = createMapFromTemplate({ node: node.path }); const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [f.path], getDirectoryPath(f.path), emptySafeList, cache, { enable: true }, ["fs", "bar"]); @@ -1107,19 +958,11 @@ namespace ts.projectSystem { }); it("should search only 2 levels deep", () => { - const app = { - path: "/app.js", - content: "", - }; - const a = { - path: "/node_modules/a/package.json", - content: JSON.stringify({ name: "a" }), - }; - const b = { - path: "/node_modules/a/b/package.json", - content: JSON.stringify({ name: "b" }), - }; - const host = createServerHost([app, a, b]); + const host = new mocks.MockServerHost({ safeList: true }); + const app = host.vfs.addFile("/app.js"); + host.vfs.addFile("/node_modules/a/package.json", `{ "name": "a" }`); + host.vfs.addFile("/node_modules/a/b/package.json", `{ "name": "b" }`); + const cache = createMap(); const logger = trackingLogger(); const result = JsTyping.discoverTypings(host, logger.log, [app.path], getDirectoryPath(app.path), emptySafeList, cache, { enable: true }, /*unresolvedImports*/ []); @@ -1139,22 +982,18 @@ namespace ts.projectSystem { describe("telemetry events", () => { it("should be received", () => { - const f1 = { - path: "/a/app.js", - content: "" - }; - const packageFile = { - path: "/a/package.json", - content: JSON.stringify({ dependencies: { commander: "1.0.0" } }) - }; + const host = new mocks.MockServerHost({ safeList: true }); + const f1 = host.vfs.addFile("/a/app.js", ``); + host.vfs.addFile("/a/package.json", `{ "dependencies": { "commander": "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]); + let seenTelemetryEvent = false; - const installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); } @@ -1174,7 +1013,8 @@ namespace ts.projectSystem { } super.sendResponse(response); } - })(); + }; + const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); @@ -1189,23 +1029,19 @@ namespace ts.projectSystem { describe("progress notifications", () => { it("should be sent for success", () => { - const f1 = { - path: "/a/app.js", - content: "" - }; - const packageFile = { - path: "/a/package.json", - content: JSON.stringify({ dependencies: { commander: "1.0.0" } }) - }; + const host = new mocks.MockServerHost({ safeList: true }); + const f1 = host.vfs.addFile("/a/app.js", ``); + host.vfs.addFile("/a/package.json", `{ "dependencies": { "commander": "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]); + let beginEvent: server.BeginInstallTypes; let endEvent: server.EndInstallTypes; - const installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); } @@ -1225,7 +1061,8 @@ namespace ts.projectSystem { } super.sendResponse(response); } - })(); + }; + const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); @@ -1241,19 +1078,15 @@ namespace ts.projectSystem { }); it("should be sent for error", () => { - const f1 = { - path: "/a/app.js", - content: "" - }; - const packageFile = { - path: "/a/package.json", - content: JSON.stringify({ dependencies: { commander: "1.0.0" } }) - }; + // const host = createServerHost([f1, packageFile]); + const host = new mocks.MockServerHost({ safeList: true }); + const f1 = host.vfs.addFile("/a/app.js", ``); + host.vfs.addFile("/a/package.json", `{ "dependencies": { "commander": "1.0.0" } }`); + const cachePath = "/a/cache/"; - const host = createServerHost([f1, packageFile]); let beginEvent: server.BeginInstallTypes; let endEvent: server.EndInstallTypes; - const installer: Installer = new (class extends Installer { + const installer = new class extends Installer { constructor() { super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); } @@ -1271,7 +1104,8 @@ namespace ts.projectSystem { } super.sendResponse(response); } - })(); + }; + const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); diff --git a/src/harness/utils.ts b/src/harness/utils.ts index 4d0d43d7fba18..5cc43c6ed38c5 100644 --- a/src/harness/utils.ts +++ b/src/harness/utils.ts @@ -33,4 +33,26 @@ namespace utils { export function removeTestPathPrefixes(text: string) { return text !== undefined ? text.replace(testPathPrefixRegExp, "") : undefined; } + + /** + * SameValueZero (from ECMAScript spec), which has stricter equality sematics than "==" or "===". + */ + export function is(x: any, y: any) { + return (x === y) ? (x !== 0 || 1 / x === 1 / y) : (x !== x && y !== y); + } + + export interface Theory { + title: string; + args: any[]; + } + + export function theory(name: string, data: (Theory | any[])[], callback: (...args: any[]) => any) { + describe(name, () => { + for (const theory of data) { + const title = Array.isArray(theory) ? theory.toString() : theory.title; + const args = Array.isArray(theory) ? theory : theory.args; + it(title, () => callback(...args)); + } + }); + } } \ No newline at end of file diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index 92f34f6b832cb..aa2cc0e6e104b 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -88,6 +88,7 @@ namespace vfs { interface DirectoryWatcherEntryArray extends Array { recursiveCount?: number; + nonRecursiveCount?: number; } interface DirectoryWatcherEntry { @@ -118,6 +119,9 @@ namespace vfs { } export class VirtualFileSystem extends VirtualFileSystemObject { + public watchFiles = true; + public watchDirectories = true; + private static _builtLocal: VirtualFileSystem | undefined; private static _builtLocalCI: VirtualFileSystem | undefined; private static _builtLocalCS: VirtualFileSystem | undefined; @@ -128,7 +132,10 @@ namespace vfs { private _currentDirectoryStack: string[] | undefined; private _shadowRoot: VirtualFileSystem | undefined; private _watchedFiles: core.KeyedCollection | undefined; + private _watchedFilesSet: core.SortedSet | undefined; private _watchedDirectories: core.KeyedCollection | undefined; + private _watchedRecursiveDirectoriesSet: core.SortedSet | undefined; + private _watchedNonRecursiveDirectoriesSet: core.SortedSet | undefined; private _stringComparer: ts.Comparer | undefined; private _pathComparer: ts.Comparer | undefined; private _metadata: core.Metadata; @@ -153,6 +160,18 @@ namespace vfs { : vpath.compareCaseInsensitive); } + public get watchedFiles(): ReadonlySet { + return this.watchedFilesSetPrivate; + } + + public get watchedRecursiveDirectories(): ReadonlySet { + return this.watchedRecursiveDirectoriesSetPrivate; + } + + public get watchedNonRecursiveDirectories(): ReadonlySet { + return this.watchedNonRecursiveDirectoriesSetPrivate; + } + /** * Gets the file system shadowed by this instance. */ @@ -181,6 +200,26 @@ namespace vfs { return this._currentDirectory; } + private get watchedFilesPrivate() { + return this._watchedFiles || (this._watchedFiles = new core.KeyedCollection(this.pathComparer)); + } + + private get watchedFilesSetPrivate() { + return this._watchedFilesSet || (this._watchedFilesSet = new core.SortedSet(this.pathComparer)); + } + + private get watchedDirectoriesPrivate() { + return this._watchedDirectories || (this._watchedDirectories = new core.KeyedCollection(this.pathComparer)) + } + + private get watchedRecursiveDirectoriesSetPrivate() { + return this._watchedRecursiveDirectoriesSet || (this._watchedRecursiveDirectoriesSet = new core.SortedSet(this.pathComparer)); + } + + private get watchedNonRecursiveDirectoriesSetPrivate() { + return this._watchedNonRecursiveDirectoriesSet || (this._watchedNonRecursiveDirectoriesSet = new core.SortedSet(this.pathComparer)); + } + private get root(): VirtualRoot { if (this._root === undefined) { if (this._shadowRoot) { @@ -361,8 +400,13 @@ namespace vfs { */ public writeFile(path: string, content: string): void { path = vpath.resolve(this.currentDirectory, path); - const file = this.getFile(path) || this.addFile(path); - if (file) file.writeContent(content); + const file = this.getFile(path); + if (file) { + file.writeContent(content); + } + else { + this.addFile(path, content); + } } /** @@ -508,25 +552,24 @@ namespace vfs { * Watch a path for changes to a file. */ public watchFile(path: string, watcher: (path: string, change: FileSystemChange) => void): ts.FileWatcher { - if (!this._watchedFiles) { - const pathComparer = this.useCaseSensitiveFileNames ? vpath.compareCaseSensitive : vpath.compareCaseInsensitive; - this._watchedFiles = new core.KeyedCollection(pathComparer); - } - path = vpath.resolve(this.currentDirectory, path); - let watchers = this._watchedFiles.get(path); - if (!watchers) this._watchedFiles.set(path, watchers = []); + let watchers = this.watchedFilesPrivate.get(path); + if (!watchers) { + this.watchedFilesPrivate.set(path, watchers = []); + this.watchedFilesSetPrivate.add(path); + } const entry: FileWatcherEntry = { watcher }; watchers.push(entry); return { close: () => { - const watchers = this._watchedFiles.get(path); + const watchers = this.watchedFilesPrivate.get(path); if (watchers) { ts.orderedRemoveItem(watchers, entry); if (watchers.length === 0) { - this._watchedFiles.delete(path); + this.watchedFilesPrivate.delete(path); + this.watchedFilesSetPrivate.delete(path); } } } @@ -543,27 +586,48 @@ namespace vfs { } path = vpath.resolve(this.currentDirectory, path); - let watchers = this._watchedDirectories.get(path); + let watchers = this.watchedDirectoriesPrivate.get(path); if (!watchers) { watchers = []; watchers.recursiveCount = 0; - this._watchedDirectories.set(path, watchers); + watchers.nonRecursiveCount = 0; + this.watchedDirectoriesPrivate.set(path, watchers); } const entry: DirectoryWatcherEntry = { watcher, recursive }; watchers.push(entry); - if (recursive) watchers.recursiveCount++; + if (recursive) { + if (watchers.recursiveCount === 0) { + this.watchedRecursiveDirectoriesSetPrivate.add(path); + } + watchers.recursiveCount++; + } + else { + if (watchers.nonRecursiveCount === 0) { + this.watchedNonRecursiveDirectoriesSetPrivate.add(path); + } + watchers.nonRecursiveCount++; + } return { close: () => { - const watchers = this._watchedDirectories.get(path); + const watchers = this.watchedDirectoriesPrivate.get(path); if (watchers) { ts.orderedRemoveItem(watchers, entry); - if (watchers.length === 0) { - this._watchedDirectories.delete(path); - } - else if (entry.recursive) { + if (entry.recursive) { watchers.recursiveCount--; + if (watchers.recursiveCount === 0) { + this.watchedRecursiveDirectoriesSetPrivate.delete(path); + } + } + else { + watchers.nonRecursiveCount--; + if (watchers.nonRecursiveCount === 0) { + this.watchedNonRecursiveDirectoriesSetPrivate.delete(path); + } + } + if (watchers.length === 0) { + this.watchedDirectoriesPrivate.delete(path); } } } @@ -603,26 +667,31 @@ namespace vfs { } private onRootFileSystemChange(path: string, change: FileSystemChange) { - const fileWatchers = this._watchedFiles && this._watchedFiles.get(path); - if (fileWatchers) { - for (const { watcher } of fileWatchers) { - watcher(path, change); + if (this.watchFiles) { + const fileWatchers = this._watchedFiles && this._watchedFiles.get(path); + if (fileWatchers) { + for (const { watcher } of fileWatchers) { + watcher(path, change); + } } } - if (this._watchedDirectories && (change === "added" || change === "removed")) { - const ignoreCase = !this.useCaseSensitiveFileNames; - const dirname = vpath.dirname(path); - this._watchedDirectories.forEach((watchers, path) => { - const exactMatch = vpath.equals(dirname, path, ignoreCase); - if (exactMatch || (watchers.recursiveCount > 0 && vpath.beneath(dirname, path, ignoreCase))) { - for (const { recursive, watcher } of watchers) { - if (exactMatch || !recursive) { - watcher(path); + if (this.watchDirectories) { + if (this._watchedDirectories && (change === "added" || change === "removed")) { + const ignoreCase = !this.useCaseSensitiveFileNames; + const dirname = vpath.dirname(path); + this._watchedDirectories.forEach((watchers, watchedPath) => { + const nonRecursiveMatch = watchers.nonRecursiveCount > 0 && vpath.equals(watchedPath, dirname, ignoreCase); + const recursiveMatch = watchers.recursiveCount > 0 && vpath.beneath(watchedPath, dirname, ignoreCase); + if (nonRecursiveMatch || recursiveMatch) { + for (const { recursive, watcher } of watchers) { + if (recursive ? recursiveMatch : nonRecursiveMatch) { + watcher(path); + } } } - } - }); + }); + } } } } @@ -766,10 +835,16 @@ namespace vfs { protected static _setNameUnsafe(entry: VirtualFileSystemEntry, name: string) { entry._name = name; + entry.invalidate(); } protected static _setParentUnsafe(entry: VirtualFileSystemEntry, parent: VirtualDirectory) { entry._parent = parent; + entry.invalidate(); + } + + protected static _invalidate(entry: VirtualFileSystemEntry) { + entry.invalidate(); } protected shadowPreamble(parent: VirtualDirectory): void { @@ -812,6 +887,10 @@ namespace vfs { this._mtimeMS = Date.now(); } } + + protected invalidate() { + this._path = undefined; + } } export interface VirtualDirectory { @@ -879,6 +958,10 @@ namespace vfs { return this._shadowRoot; } + protected get hasOwnEntries() { + return this._entries !== undefined; + } + /** * Gets the child entries in this directory for the provided options. */ @@ -1253,6 +1336,19 @@ namespace vfs { return true; } + protected invalidate() { + super.invalidate(); + this.invalidateEntries(); + } + + protected invalidateEntries() { + if (this.hasOwnEntries) { + for (const entry of Array.from(this.getOwnEntries().values())) { + VirtualFileSystemEntry._invalidate(entry); + } + } + } + private parsePath(path: string) { return vpath.parse(vpath.normalize(path)); } @@ -1434,6 +1530,10 @@ namespace vfs { return this._allViews; } + protected invalidateEntries() { + this.invalidateTarget(); + } + private getView(entry: VirtualFile): VirtualFileView; private getView(entry: VirtualDirectory): VirtualDirectoryView; private getView(entry: VirtualEntry): VirtualEntryView; @@ -1788,6 +1888,11 @@ namespace vfs { return super.getStatsCore(S_IFLNK, this.targetPath.length); } + protected invalidate() { + super.invalidate(); + this.invalidateTarget(); + } + private resolveTarget() { if (!this._target) { const entry = findTarget(this.fileSystem, this.targetPath); diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index c1d99edb8ed13..b4b8a8141f018 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -5,7 +5,7 @@ namespace ts.TestFSWithWatch { export const libFile: FileOrFolder = { - path: "/a/lib/lib.d.ts", + path: "/.ts/lib.d.ts", content: `/// interface Boolean {} interface Function {} @@ -41,10 +41,24 @@ interface Array {}` useWindowsStylePaths?: boolean; } - export function createWatchedSystem(fileOrFolderList: ReadonlyArray, params?: TestServerHostCreationParameters): TestServerHost { - if (!params) { - params = {}; - } + export function createWatchedSystem(fileOrFolderList: ReadonlyArray, params: TestServerHostCreationParameters = {}) { + // const host = new mocks.MockServerHost({ + // vfs: { + // currentDirectory: params.currentDirectory, + // useCaseSensitiveFileNames: params.useCaseSensitiveFileNames + // }, + // executingFilePath: params.executingFilePath, + // newLine: params.newLine as "\r\n" | "\n" + // }); + // for (const entry of fileOrFolderList) { + // if (typeof entry.content === "string") { + // host.vfs.addFile(entry.path, entry.content); + // } + // else { + // host.vfs.addDirectory(entry.path); + // } + // } + // if (params.useWindowsStylePaths) throw new Error("Not supported"); const host = new TestServerHost(/*withSafelist*/ false, params.useCaseSensitiveFileNames !== undefined ? params.useCaseSensitiveFileNames : false, params.executingFilePath || getExecutingFilePathFromLibFile(), @@ -153,11 +167,25 @@ interface Array {}` } } - export function checkWatchedFiles(host: TestServerHost, expectedFiles: string[]) { + function checkSortedSet(set: ReadonlySet, values: ReadonlyArray) { + assert.strictEqual(set.size, values.length, `Actual: ${Array.from(set)}, expected: ${values}.`); + for (const value of values) { + assert.isTrue(set.has(value)); + } + } + + export function checkWatchedFiles(host: TestServerHost | mocks.MockServerHost, expectedFiles: string[]) { + if (host instanceof mocks.MockServerHost) { + return checkSortedSet(host.vfs.watchedFiles, expectedFiles); + } + checkMapKeys("watchedFiles", host.watchedFiles, expectedFiles); } - export function checkWatchedDirectories(host: TestServerHost, expectedDirectories: string[], recursive = false) { + export function checkWatchedDirectories(host: TestServerHost | mocks.MockServerHost, expectedDirectories: string[], recursive = false) { + if (host instanceof mocks.MockServerHost) { + return checkSortedSet(recursive ? host.vfs.watchedRecursiveDirectories : host.vfs.watchedNonRecursiveDirectories, expectedDirectories); + } checkMapKeys(`watchedDirectories${recursive ? " recursive" : ""}`, recursive ? host.watchedDirectoriesRecursive : host.watchedDirectories, expectedDirectories); } @@ -244,6 +272,16 @@ interface Array {}` ignoreWatchInvokedWithTriggerAsFileCreate: boolean; } + function createFileMatcher(host: TestServerHost, path: string) { + path = host.getCanonicalFileName(host.getHostSpecificPath(path)); + return (file: FileOrFolder) => host.getCanonicalFileName(host.getHostSpecificPath(file.path)) === path && isString(file.content); + } + + function createFolderMatcher(host: TestServerHost, path: string) { + path = host.getCanonicalFileName(host.getHostSpecificPath(path)); + return (file: FileOrFolder) => host.getCanonicalFileName(host.getHostSpecificPath(file.path)) === path && !isString(file.content); + } + export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost { args: string[] = []; @@ -260,6 +298,63 @@ interface Array {}` readonly watchedFiles = createMultiMap(); private readonly executingFilePath: string; private readonly currentDirectory: string; + public files: FileOrFolder[] = []; + + // temporary vfs shim + public vfs = { + addFile: (path: string, content: string, options?: { overwrite?: boolean }) => { + let file = this.files.find(createFileMatcher(this, path)); + if (file) { + if (!(options && options.overwrite)) return undefined; + file.content = content; + } + else { + file = { path, content }; + this.files.push(file); + } + this.reloadFS(this.files); + return file; + }, + writeFile: (path: string, content: string) => { + let file = this.files.find(createFileMatcher(this, path)); + if (file) { + file.content = content; + } + else { + file = { path, content }; + this.files.push(file); + } + this.reloadFS(this.files); + }, + getFile: (path: string) => { + return this.files.find(createFileMatcher(this, path)); + }, + removeFile: (path: string) => { + const index = this.files.findIndex(createFileMatcher(this, path)); + if (index >= 0) { + ts.orderedRemoveItemAt(this.files, index); + this.reloadFS(this.files); + } + }, + renameFile: (oldpath: string, newpath: string) => { + const oldItem = this.vfs.getFile(oldpath); + if (oldItem) { + const newIndex = this.files.findIndex(createFileMatcher(this, newpath)); + if (newIndex >= 0) ts.orderedRemoveItemAt(this.files, newIndex); + oldItem.path = newpath; + this.reloadFS(this.files); + } + }, + addDirectory: (path: string) => { + let file = this.files.find(createFolderMatcher(this, path)); + if (!file) { + file = { path }; + this.files.push(file); + this.reloadFS(this.files); + } + return file; + }, + }; constructor(public withSafeList: boolean, public useCaseSensitiveFileNames: boolean, executingFilePath: string, currentDirectory: string, fileOrFolderList: ReadonlyArray, public readonly newLine = "\n", public readonly useWindowsStylePath?: boolean) { this.getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); @@ -291,7 +386,9 @@ interface Array {}` reloadFS(fileOrFolderList: ReadonlyArray, options?: Partial) { const mapNewLeaves = createMap(); const isNewFs = this.fs.size === 0; - fileOrFolderList = fileOrFolderList.concat(this.withSafeList ? safeList : []); + if (this.files !== fileOrFolderList) { + this.files = fileOrFolderList = fileOrFolderList.concat(this.withSafeList ? safeList : []); + } const filesOrFoldersToLoad: ReadonlyArray = !this.useWindowsStylePath ? fileOrFolderList : fileOrFolderList.map(f => { const result = clone(f); From fa428356d55060f6cf9bdf6c453e75c713246d63 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 22 Nov 2017 18:59:59 -0800 Subject: [PATCH 15/54] Switch to function spies --- package.json | 1 + scripts/typemock/gulpfile.js | 3 +- scripts/typemock/src/arg.ts | 133 ++-- scripts/typemock/src/index.ts | 27 +- scripts/typemock/src/{stub.ts => inject.ts} | 10 +- scripts/typemock/src/mock.ts | 519 +++++++++++----- scripts/typemock/src/spy.ts | 38 -- scripts/typemock/src/tests/argTests.ts | 193 +++--- scripts/typemock/src/tests/index.ts | 2 +- scripts/typemock/src/tests/injectTests.ts | 79 +++ scripts/typemock/src/tests/mockTests.ts | 571 +++++++++++------- scripts/typemock/src/tests/stubTests.ts | 79 --- scripts/typemock/src/tests/timersTests.ts | 128 ++-- src/harness/{mocks.ts => fakes.ts} | 24 +- src/harness/tsconfig.json | 4 +- src/harness/typemock.ts | 122 ++-- src/harness/unittests/compileOnSave.ts | 42 +- src/harness/unittests/projectErrors.ts | 10 +- .../unittests/reuseProgramStructure.ts | 5 +- src/harness/unittests/tscWatchMode.ts | 359 +++++------ .../unittests/tsserverProjectSystem.ts | 4 +- src/harness/unittests/typingsInstaller.ts | 533 ++++++++-------- src/harness/vfs.ts | 2 +- src/harness/virtualFileSystemWithWatch.ts | 42 +- src/server/editorServices.ts | 2 +- 25 files changed, 1523 insertions(+), 1409 deletions(-) rename scripts/typemock/src/{stub.ts => inject.ts} (83%) delete mode 100644 scripts/typemock/src/spy.ts create mode 100644 scripts/typemock/src/tests/injectTests.ts delete mode 100644 scripts/typemock/src/tests/stubTests.ts rename src/harness/{mocks.ts => fakes.ts} (90%) diff --git a/package.json b/package.json index 583e59a774122..32a477520a830 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "travis-fold": "latest", "ts-node": "latest", "tslint": "latest", + "typemock": "file:scripts/typemock", "typescript": "next", "vinyl": "latest", "xml2js": "^0.4.19" diff --git a/scripts/typemock/gulpfile.js b/scripts/typemock/gulpfile.js index 127ef3dc51e69..6e7119ac2d8f5 100644 --- a/scripts/typemock/gulpfile.js +++ b/scripts/typemock/gulpfile.js @@ -23,7 +23,6 @@ gulp.task("test", ["build"], () => gulp .src(["dist/tests/index.js"], { read: false }) .pipe(mocha({ reporter: "dot" }))); - -gulp.task("watch", ["test"], () => gulp.watch(["src/**/*"], ["test"])); +gulp.task("watch", () => gulp.watch(["src/**/*"], ["test"])); gulp.task("default", ["test"]); \ No newline at end of file diff --git a/scripts/typemock/src/arg.ts b/scripts/typemock/src/arg.ts index 7d6feb5383d48..022b31ffb7ccb 100644 --- a/scripts/typemock/src/arg.ts +++ b/scripts/typemock/src/arg.ts @@ -2,19 +2,21 @@ * Represents an argument condition used during verification. */ export class Arg { - private _condition: (value: any, args: ReadonlyArray, index: number) => { valid: boolean, next?: number }; + private _validate: (value: any) => boolean; private _message: string; + private _rest: boolean; - private constructor(condition: (value: any, args: ReadonlyArray, index: number) => { valid: boolean, next?: number }, message: string) { - this._condition = condition; + private constructor(condition: (value: any) => boolean, message: string, rest = false) { + this._validate = condition; this._message = message; + this._rest = rest; } /** * Allows any value. */ public static any(): T & Arg { - return new Arg(() => ({ valid: true }), `any`); + return new Arg(() => true, `any`); } /** @@ -22,14 +24,14 @@ export class Arg { * @param match The condition used to match the value. */ public static is(match: (value: T) => boolean): T & Arg { - return new Arg(value => ({ valid: match(value) }), `is`); + return new Arg(match, `is`); } /** * Allows only a null value. */ public static null(): T & Arg { - return new Arg(value => ({ valid: value === null }), `null`); + return new Arg(value => value === null, `null`); } /** @@ -43,7 +45,7 @@ export class Arg { * Allows only an undefined value. */ public static undefined(): T & Arg { - return new Arg(value => ({ valid: value === undefined }), `undefined`); + return new Arg(value => value === undefined, `undefined`); } /** @@ -67,20 +69,24 @@ export class Arg { return Arg.not(Arg.nullOrUndefined()); } + public static optional(condition: T | T & Arg): T & Arg { + return Arg.or(condition, Arg.undefined()); + } + /** * Allows any value within the provided range. * @param min The minimum value. * @param max The maximum value. */ public static between(min: T, max: T): T & Arg { - return new Arg(value => ({ valid: min <= value && value <= max }), `between ${min} and ${max}`); + return new Arg(value => min <= value && value <= max, `between ${min} and ${max}`); } /** * Allows any value in the provided array. */ public static in(values: T[]): T & Arg { - return new Arg(value => ({ valid: values.indexOf(value) > -1 }), `in ${values.join(", ")}`); + return new Arg(value => values.indexOf(value) > -1, `in ${values.join(", ")}`); } /** @@ -94,19 +100,26 @@ export class Arg { * Allows any value that matches the provided pattern. */ public static match(pattern: RegExp): T & Arg { - return new Arg(value => ({ valid: pattern.test(value) }), `matches ${pattern}`); + return new Arg(value => pattern.test(value), `matches ${pattern}`); } public static startsWith(text: string): string & Arg { - return new Arg(value => ({ valid: String(value).startsWith(text) }), `starts with ${text}`); + return new Arg(value => typeof value === "string" && value.startsWith(text), `starts with ${text}`); } public static endsWith(text: string): string & Arg { - return new Arg(value => ({ valid: String(value).endsWith(text) }), `ends with ${text}`); + return new Arg(value => typeof value === "string" && value.endsWith(text), `ends with ${text}`); + } + + public static includes(value: string): string & string[] & Arg; + public static includes(value: T): T[] & Arg; + public static includes(value: T): Arg { + return new Arg(value_ => Array.isArray(value_) ? value_.includes(value) : typeof value_ === "string" && value_.includes("" + value), `contains ${value}`); } - public static includes(text: string): string & Arg { - return new Arg(value => ({ valid: String(value).includes(text) }), `contains ${text}`); + public static array(values: (T | T & Arg)[]): T[] & Arg { + const conditions = values.map(Arg.from); + return new Arg(value => value.length === conditions.length && Arg.validateAll(conditions, value), `array [${conditions.join(", ")}]`); } /** @@ -142,7 +155,7 @@ export class Arg { */ public static typeof(tag: string): T & Arg; public static typeof(tag: string): any { - return new Arg(value => ({ valid: typeof value === tag }), `typeof ${tag}`); + return new Arg(value => typeof value === tag, `typeof ${tag}`); } public static string() { return this.typeof("string"); } @@ -157,21 +170,21 @@ export class Arg { * @param type The expected constructor. */ public static instanceof(type: TClass): TClass["prototype"] & Arg { - return new Arg(value => ({ valid: value instanceof type }), `instanceof ${type.name}`); + return new Arg(value => value instanceof type, `instanceof ${type.name}`); } /** * Allows any value that has the provided property names in its prototype chain. */ public static has(...names: string[]): T & Arg { - return new Arg(value => ({ valid: names.filter(name => name in value).length === names.length }), `has ${names.join(", ")}`); + return new Arg(value => names.filter(name => name in value).length === names.length, `has ${names.join(", ")}`); } /** * Allows any value that has the provided property names on itself but not its prototype chain. */ public static hasOwn(...names: string[]): T & Arg { - return new Arg(value => ({ valid: names.filter(name => Object.prototype.hasOwnProperty.call(value, name)).length === names.length }), `hasOwn ${names.join(", ")}`); + return new Arg(value => names.filter(name => Object.prototype.hasOwnProperty.call(value, name)).length === names.length, `hasOwn ${names.join(", ")}`); } /** @@ -180,21 +193,11 @@ export class Arg { */ public static rest(condition?: T | (T & Arg)): T & Arg { if (condition === undefined) { - return new Arg((_, args) => ({ valid: true, next: args.length }), `rest`); + return new Arg(() => true, `rest`, /*rest*/ true); } const arg = Arg.from(condition); - return new Arg( - (_, args, index) => { - while (index < args.length) { - const { valid, next } = Arg.validate(arg, args, index); - if (!valid) return { valid: false }; - index = typeof next === "undefined" ? index + 1 : next; - } - return { valid: true, next: index }; - }, - `rest ${arg._message}` - ); + return new Arg(value => arg._validate(value), `rest ${arg._message}`, /*rest*/ true); } /** @@ -202,10 +205,7 @@ export class Arg { */ public static not(value: T | (T & Arg)): T & Arg { const arg = Arg.from(value); - return new Arg((value, args, index) => { - const result = arg._condition(value, args, index); - return { valid: !result.valid, next: result.next }; - }, `not ${arg._message}`); + return new Arg(value => !arg._validate(value), `not ${arg._message}`); } /** @@ -213,20 +213,15 @@ export class Arg { */ public static and(...args: ((T & Arg) | T)[]): T & Arg { const conditions = args.map(Arg.from); - return new Arg((value, args, index) => { - for (const condition of conditions) { - const result = condition._condition(value, args, index); - if (!result.valid) return { valid: false }; - } - return { valid: true }; - }, conditions.map(condition => condition._message).join(" and ")); + return new Arg(value => conditions.every(condition => condition._validate(value)), conditions.map(condition => condition._message).join(" and ")); } /** * Combines conditions, where no condition may be `true`. */ public static nand(...args: ((T & Arg) | T)[]): T & Arg { - return this.not(this.and(...args)); + const conditions = args.map(Arg.from); + return new Arg(value => !conditions.every(condition => condition._validate(value)), "not " + conditions.map(condition => condition._message).join(" and ")); } /** @@ -234,20 +229,15 @@ export class Arg { */ public static or(...args: ((T & Arg) | T)[]): T & Arg { const conditions = args.map(Arg.from); - return new Arg((value, args, index) => { - for (const condition of conditions) { - const result = condition._condition(value, args, index); - if (result.valid) return { valid: true }; - } - return { valid: false }; - }, conditions.map(condition => condition._message).join(" or ")); + return new Arg(value => conditions.some(condition => condition._validate(value)), conditions.map(condition => condition._message).join(" or ")); } /** * Combines conditions, where all conditions must be `true`. */ public static nor(...args: ((T & Arg) | T)[]): T & Arg { - return this.not(this.or(...args)); + const conditions = args.map(Arg.from); + return new Arg(value => !conditions.some(condition => condition._validate(value)), "neither " + conditions.map(condition => condition._message).join(" nor ")); } /** @@ -256,25 +246,40 @@ export class Arg { * @returns The condition */ public static from(value: T): T & Arg { - if (value instanceof Arg) { - return value; - } + return value instanceof Arg ? value : + value === undefined ? Arg.undefined() : + value === null ? Arg.null() : + new Arg(v => is(v, value), JSON.stringify(value)); + } - return new Arg(v => ({ valid: is(v, value) }), JSON.stringify(value)); + /** + * Validates an argument against a condition + * @param condition The condition to validate. + * @param arg The argument to validate against the condition. + */ + public static validate(condition: Arg, arg: any): boolean { + return condition._validate(arg); } /** * Validates the arguments against the condition. - * @param args The arguments for the execution - * @param index The current index into the `args` array - * @returns An object that specifies whether the condition is `valid` and what the `next` index should be. - */ - public static validate(arg: Arg, args: ReadonlyArray, index: number): { valid: boolean, next?: number } { - const value = index >= 0 && index < args.length ? args[index] : undefined; - const { valid, next } = arg._condition(value, args, index); - return valid - ? { valid: true, next: next === undefined ? index + 1 : next } - : { valid: false }; + * @param conditions The conditions to validate. + * @param args The arguments for the execution. + */ + public static validateAll(conditions: ReadonlyArray, args: ReadonlyArray): boolean { + const length = Math.max(conditions.length, args.length); + let conditionIndex = 0; + let argIndex = 0; + while (argIndex < length) { + const condition = conditionIndex < conditions.length ? conditions[conditionIndex] : undefined; + const arg = argIndex < args.length ? args[argIndex] : undefined; + if (!condition) return false; + if (argIndex >= args.length && condition._rest) return true; + if (!condition._validate(arg)) return false; + if (!condition._rest) conditionIndex++; + argIndex++; + } + return true; } /** diff --git a/scripts/typemock/src/index.ts b/scripts/typemock/src/index.ts index aa94febd01b79..1626ee04e4b83 100644 --- a/scripts/typemock/src/index.ts +++ b/scripts/typemock/src/index.ts @@ -1,6 +1,25 @@ export { Arg } from "./arg"; export { Times } from "./times"; -export { Mock, Returns, Throws } from "./mock"; -export { Spy, Callable, Constructable } from "./spy"; -export { Stub } from "./stub"; -export { Timers, Timer, Timeout, Interval, Immediate, AnimationFrame } from "./timers"; \ No newline at end of file +export { Mock, Spy, Returns, Throws, ThisArg, Callback, Fallback, Setup, Callable, Constructable } from "./mock"; +export { Inject } from "./inject"; +export { Timers, Timer, Timeout, Interval, Immediate, AnimationFrame } from "./timers"; + +import { Mock, Spy, Callable, Constructable } from "./mock"; + +/** + * Creates a spy on an object or function. + */ +export function spy(): Mock; +/** + * Creates a spy on an object or function. + */ +export function spy(target: T): Mock; +/** + * Installs a spy on a method of an object. Use `revoke()` on the result to reset the spy. + * @param object The object containing a method. + * @param propertyKey The name of the method on the object. + */ +export function spy any }, K extends keyof T>(object: T, propertyKey: K): Spy; +export function spy any }, K extends keyof T>(object?: T, propertyKey?: K) { + return object === undefined ? Mock.spy() : propertyKey === undefined ? Mock.spy(object) : Mock.spy(object, propertyKey); +} diff --git a/scripts/typemock/src/stub.ts b/scripts/typemock/src/inject.ts similarity index 83% rename from scripts/typemock/src/stub.ts rename to scripts/typemock/src/inject.ts index e643aae44d616..d7b27fe829077 100644 --- a/scripts/typemock/src/stub.ts +++ b/scripts/typemock/src/inject.ts @@ -1,7 +1,7 @@ /** * Temporarily injects a value into an object property */ -export class Stub { +export class Inject { private _target: T; private _key: K; private _value: any; @@ -28,11 +28,11 @@ export class Stub { return this._key; } - public get stubValue(): T[K] { + public get injectedValue(): T[K] { return this._installed ? this.currentValue : this._value; } - public set stubValue(value: T[K]) { + public set injectedValue(value: T[K]) { if (this._installed) { this._target[this._key] = value; } @@ -79,8 +79,8 @@ export class Stub { this._originalValue = null; } - public static exec(target: T, propertyKey: K, value: T[K], action: () => V) { - const stub = new Stub(target, propertyKey, value); + public static exec(target: T, propertyKey: K, value: T[K], action: () => V) { + const stub = new Inject(target, propertyKey, value); return stub.exec(action); } diff --git a/scripts/typemock/src/mock.ts b/scripts/typemock/src/mock.ts index 85d441c838235..b4dfd9e0af946 100644 --- a/scripts/typemock/src/mock.ts +++ b/scripts/typemock/src/mock.ts @@ -1,28 +1,53 @@ import { Times } from "./times"; import { Arg } from "./arg"; +import { Inject } from "./inject"; const weakHandler = new WeakMap>(); +const weakMock = new WeakMap>(); function noop() {} +const empty = {}; -function getHandler(value: object) { - return weakHandler.get(value); +export type Callable = (...args: any[]) => any; + +export type Constructable = new (...args: any[]) => any; + +export interface ThisArg { + this: any; } export interface Returns { - returns: U; + return: U; +} + +export interface Fallback { + fallback: true; } export interface Throws { - throws: any; + throw: any; } +export interface Callback { + callback: Callable; +} + +export type Setup = + | Returns & (ThisArg & Callback | ThisArg | Callback) + | Returns + | Throws & (ThisArg & Callback | ThisArg | Callback) + | Throws + | Fallback & (ThisArg & Callback | ThisArg | Callback) + | Fallback + | ThisArg & Callback + | ThisArg + | Callback; + /** * A mock version of another oject */ export class Mock { - private _target: T; - private _handler = new MockHandler(); + private _handler: MockHandler; private _proxy: T; private _revoke: () => void; @@ -32,13 +57,16 @@ export class Mock { * @param setups Optional setups to use */ constructor(target: T = {}, setups?: Partial) { - this._target = target; + this._handler = typeof target === "function" + ? new MockFunctionHandler() + : new MockHandler(); - const { proxy, revoke } = Proxy.revocable(this._target, this._handler); + const { proxy, revoke } = Proxy.revocable(target, this._handler); this._proxy = proxy; this._revoke = revoke; weakHandler.set(proxy, this._handler); + weakMock.set(proxy, this); if (setups) { this.setup(setups); @@ -48,24 +76,66 @@ export class Mock { /** * Gets the mock version of the target */ - public get value(): T { + public get proxy(): T { return this._proxy; } + /** + * Creates an empty Mock object. + */ + public static object() { + return new Mock({}); + } + + /** + * Creates an empty Mock function. + */ + public static function() { + return new Mock(function () {}); + } + + /** + * Creates a function spy. + */ + public static spy(): Mock; + /** + * Creates a spy on an object or function. + */ + public static spy(target: T): Mock; + /** + * Installs a spy on a method of an object. Use `revoke()` on the result to reset the spy. + * @param object The object containing a method. + * @param propertyKey The name of the method on the object. + */ + public static spy any }, K extends keyof T>(object: T, propertyKey: K): Spy; + public static spy any }, K extends keyof T>(object?: T, propertyKey?: K) { + return object !== undefined && propertyKey !== undefined + ? new Spy(object, propertyKey) + : new Mock(object || noop); + } + + /** + * Gets the mock for an object. + * @param target The target. + */ + public static from(target: T) { + return | undefined>weakMock.get(target); + } + /** * Performs setup of the mock object, overriding the target object's functionality with that provided by the setup * @param callback A function used to set up a method result. * @param result An object used to describe the result of the method. * @returns This mock instance. */ - public setup(callback: (value: T) => U, result?: Returns | Throws): Mock; + public setup(callback: (value: T) => U, result?: Setup): this; /** * Performs setup of the mock object, overriding the target object's functionality with that provided by the setup * @param setups An object whose members are used instead of the target object. * @returns This mock instance. */ - public setup(setups: Partial): Mock; - public setup(setup: Partial | ((value: T) => U), result?: Returns | Throws): Mock { + public setup(setups: Partial): this; + public setup(setup: Partial | ((value: T) => U), result?: Setup): this { if (typeof setup === "function") { this._handler.setupCall(setup, result); } @@ -75,187 +145,259 @@ export class Mock { return this; } + /** + * Performs verification that a specific action occurred at least once. + * @param callback A callback that simulates the expected action. + * @param message An optional message to use if verification fails. + * @returns This mock instance. + */ + public verify(callback: (value: T) => U, message?: string): this; + /** + * Performs verification that a specific action occurred. + * @param callback A callback that simulates the expected action. + * @param times The number of times the action should have occurred. + * @param message An optional message to use if verification fails. + * @returns This mock instance. + */ + public verify(callback: (value: T) => U, times: Times, message?: string): this; /** * Performs verification that a specific action occurred. * @param callback A callback that simulates the expected action. * @param times The number of times the action should have occurred. * @returns This mock instance. */ - public verify(callback: (value: T) => any, times: Times): Mock { + public verify(callback: (value: T) => U, times?: Times | string, message?: string): this { + if (typeof times === "string") { + message = times; + times = undefined; + } + if (times === undefined) { + times = Times.atLeastOnce(); + } this._handler.verify(callback, times); return this; } public revoke() { + weakMock.delete(this._proxy); + weakHandler.delete(this._proxy); this._handler.revoke(); this._revoke(); } } -class Setup { - public recording: Recording; - public result: Partial & Throws> | undefined; +export class Spy any }, K extends keyof T> extends Mock { + private _spy: Inject | undefined; - constructor (recording: Recording, result?: Returns | Throws) { - this.recording = recording; - this.result = result; + constructor(target: T, propertyKey: K) { + super(target[propertyKey]); + this._spy = new Inject(target, propertyKey, this.proxy); + this._spy.install(); } - public static evaluate(setups: ReadonlyArray | undefined, trap: string, args: any[], newTarget?: any) { - if (setups) { - for (let i = setups.length - 1; i >= 0; i--) { - const setup = setups[i]; - if (setup.recording.trap === trap && - setup.recording.newTarget === newTarget && - setup.matchArguments(args)) { - return setup.getResult(); - } - } - } - throw new Error("No matching setups."); + public get installed() { + return this._spy ? this._spy.installed : false; + } + + public install() { + if (!this._spy) throw new Error("Cannot install a revoked spy."); + this._spy.install(); + return this; } - public matchArguments(args: any[]) { - return this.recording.matchArguments(args); + public uninstall() { + if (this._spy) this._spy.uninstall(); + return this; } - public getResult() { - if (this.result) { - if (this.result.throws) { - throw this.result.throws; - } - return this.result.returns; + public revoke() { + if (this._spy) { + this._spy.uninstall(); + this._spy = undefined; } - return undefined; + super.revoke(); } } class Recording { + public static readonly noThisArg = {}; public readonly trap: string; public readonly name: PropertyKey | undefined; - public readonly args: ReadonlyArray; + public readonly thisArg: any; + public readonly argArray: ReadonlyArray; public readonly newTarget: any; + public readonly result: Partial & Throws & Fallback> | undefined; + public readonly callback: Callable | undefined; + private _thisCondition: Arg | undefined; + private _newTargetCondition: Arg | undefined; private _conditions: ReadonlyArray | undefined; - constructor(trap: string, name: PropertyKey | undefined, args: ReadonlyArray, newTarget?: any) { + constructor(trap: string, name: PropertyKey | undefined, thisArg: any, argArray: ReadonlyArray, newTarget: any, result: Partial & Throws & Fallback> | undefined, callback: Callable | undefined) { this.trap = trap; this.name = name; - this.args = args || []; + this.thisArg = thisArg; + this.argArray = argArray || []; this.newTarget = newTarget; + this.result = result; + this.callback = callback; } - public get conditions() { - return this._conditions || (this._conditions = this.args.map(Arg.from)); + public get thisCondition() { + return this._thisCondition || (this._thisCondition = this.thisArg === Recording.noThisArg ? Arg.any() : Arg.from(this.thisArg)); } - public toString(): string { - return `${this.trap} ${this.name || ""}(${this.conditions.join(", ")})${this.newTarget ? ` [${this.newTarget.name}]` : ``}`; + public get newTargetCondition() { + return this._newTargetCondition || (this._newTargetCondition = Arg.from(this.newTarget)); } - public matchRecording(recording: Recording) { - if (recording.trap !== this.trap || - recording.name !== this.name || - recording.newTarget !== this.newTarget) { - return false; + public get argConditions() { + return this._conditions || (this._conditions = this.argArray.map(Arg.from)); + } + + public get kind() { + switch (this.trap) { + case "apply": return "function"; + case "construct": return "function"; + case "invoke": return "method"; + case "get": return "property"; + case "set": return "property"; } + } - return this.matchArguments(recording.args); + public static select(setups: ReadonlyArray, kind: Recording["kind"], name: PropertyKey | undefined) { + return setups.filter(setup => setup.kind === kind && setup.name === name); } - public matchArguments(args: ReadonlyArray) { - let argi = 0; - while (argi < this.conditions.length) { - const condition = this.conditions[argi]; - const { valid, next } = Arg.validate(condition, args, argi); - if (!valid) { - return false; + public static evaluate(setups: ReadonlyArray | undefined, trap: string, name: PropertyKey | undefined, thisArg: any, argArray: any[], newTarget: any, fallback: () => any) { + if (setups && setups.length > 0) { + for (const setup of setups) { + if (setup.match(trap, name, thisArg, argArray, newTarget)) { + const callback = setup.callback; + if (callback) { + Reflect.apply(callback, thisArg, argArray); + } + + const result = setup.getResult(fallback); + return trap === "set" ? true : result; + } } - argi = typeof next === "number" ? next : argi + 1; - } - if (argi < args.length) { - return false; + return trap === "set" ? false : undefined; } - return true; + return fallback(); } -} -class MockHandler implements ProxyHandler { - private readonly overrides = Object.create(null); - private readonly recordings: Recording[] = []; - private readonly selfSetups: Setup[] = []; - private readonly memberSetups = new Map(); - private readonly methodTargets = new WeakMap(); - private readonly methodProxies = new Map(); - private readonly methodRevocations = new Set<() => void>(); - - constructor() { - } - - public apply(target: T | Function, thisArg: any, argArray: any[]): any { - if (typeof target === "function") { - this.recordings.push(new Recording("apply", undefined, argArray)); - return this.selfSetups.length > 0 - ? Setup.evaluate(this.selfSetups, "apply", argArray) - : Reflect.apply(target, thisArg, argArray); - } - return undefined; + public toString(): string { + return `${this.trap} ${this.name || ""}(${this.argConditions.join(", ")})${this.newTarget ? ` [${this.newTarget.name}]` : ``}`; } - public construct(target: T | Function, argArray: any[], newTarget?: any): any { - if (typeof target === "function") { - this.recordings.push(new Recording("construct", undefined, argArray, newTarget)); - return this.selfSetups.length > 0 - ? Setup.evaluate(this.selfSetups, "construct", argArray, newTarget) - : Reflect.construct(target, argArray, newTarget); - } + public match(trap: string, name: PropertyKey | undefined, thisArg: any, argArray: any, newTarget: any) { + return this.trap === trap + && this.name === name + && Arg.validate(this.thisCondition, thisArg) + && Arg.validateAll(this.argConditions, argArray) + && Arg.validate(this.newTargetCondition, newTarget); + } + + public matchRecording(recording: Recording) { + return this.match(recording.trap, recording.name, recording.thisArg, recording.argArray, recording.newTarget) + && this.matchResult(recording.result); + } + + private matchThisArg(thisArg: any) { + return thisArg === Recording.noThisArg + || Arg.validate(this.thisCondition, thisArg); + } + + private matchResult(result: Partial & Throws> | undefined) { + return !this.result + || this.result.return === (result && result.return) + && this.result.throw === (result && result.throw); + } + + private getResult(fallback: () => any) { + if (hasOwn(this.result, "throw")) throw this.result.throw; + if (hasOwn(this.result, "return")) return this.result.return; + if (hasOwn(this.result, "fallback")) return this.result.fallback ? fallback() : undefined; return undefined; } +} - public get(target: T, name: PropertyKey, receiver: any): any { - this.recordings.push(new Recording("get", name, [])); - const value = Reflect.get(this.getTarget(target, name), name, receiver); - return typeof value === "function" ? this.getMethod(name, value) : value; +class MockHandler implements ProxyHandler { + protected readonly overrides = Object.create(null); + protected readonly recordings: Recording[] = []; + protected readonly setups: Recording[] = []; + protected readonly methodTargets = new WeakMap(); + protected readonly methodProxies = new Map(); + protected readonly methodRevocations = new Set<() => void>(); + + public get(target: T, name: PropertyKey, receiver: any = target): any { + const setups = Recording.select(this.setups, "property", name); + const result: Partial & Throws> = {}; + const recording = new Recording("get", name, target, [], /*newTarget*/ undefined, result, /*callback*/ undefined); + this.recordings.push(recording); + try { + const value = Recording.evaluate(setups, "get", name, receiver, [], /*newTarget*/ undefined, + () => Reflect.get(this.getTarget(target, name), name, receiver)); + return typeof value === "function" ? this.getMethod(name, value) : value; + } + catch (e) { + throw result.throw = e; + } } - public set(target: T, name: PropertyKey, value: any, receiver: any): boolean { - this.recordings.push(new Recording("set", name, [value])); + public set(target: T, name: PropertyKey, value: any, receiver: any = target): boolean { if (typeof value === "function" && this.methodTargets.has(value)) { value = this.methodTargets.get(value); } - return Reflect.set(this.getTarget(target, name), name, value, receiver); + const setups = Recording.select(this.setups, "property", name); + const result: Partial & Throws> = {}; + const recording = new Recording("set", name, target, [value], /*newTarget*/ undefined, result, /*callback*/ undefined); + this.recordings.push(recording); + try { + const success = Recording.evaluate(setups, "set", name, receiver, [value], /*newTarget*/ undefined, + () => Reflect.set(this.getTarget(target, name), name, value, receiver)); + result.return = undefined; + return success; + } + catch (e) { + throw result.throw = e; + } } public invoke(proxy: T, name: PropertyKey, method: Function, argArray: any[]): any { - this.recordings.push(new Recording("invoke", name, argArray)); - return Reflect.apply(method, proxy, argArray); + const setups = Recording.select(this.setups, "method", name); + const result: Partial & Throws> = {}; + const recording = new Recording("invoke", name, proxy, argArray, /*newTarget*/ undefined, result, /*callback*/ undefined); + this.recordings.push(recording); + try { + return Recording.evaluate(setups, "invoke", name, proxy, argArray, /*newTarget*/ undefined, + () => Reflect.apply(method, proxy, argArray)); + } + catch (e) { + throw result.throw = e; + } } - public setupCall(callback: (value: any) => any, result: Returns | Throws | undefined) { - const recording = capture(callback); - if (recording.name === undefined) { - this.selfSetups.push(new Setup(recording, result)); + public setupCall(callback: (value: any) => any, result: Setup | undefined) { + const recording = this.capture(callback, result); + const existing = this.setups.find(setup => setup.name === recording.name); + if (existing) { + if (existing.kind !== recording.kind) { + throw new Error(`Cannot mix method and property setups for the same member name.`); + } } - else { - let setups = this.memberSetups.get(recording.name); - if (!setups) { - this.memberSetups.set(recording.name, setups = []); - if (recording.trap === "invoke") { - this.defineMethod(recording.name); - } - else { - this.defineAccessor(recording.name); - } + else if (recording.name !== undefined) { + if (recording.kind === "method") { + this.defineMethod(recording.name); } - else { - if ((setups[0].recording.trap === "invoke") !== (recording.trap === "invoke")) { - throw new Error(`Cannot mix method and acessor setups for the same property.`); - } + else if (recording.kind === "property") { + this.defineAccessor(recording.name); } - - setups.push(new Setup(recording, result)); } + + this.setups.push(recording); } public setupMembers(setup: object) { @@ -270,8 +412,8 @@ class MockHandler implements ProxyHandler { } } - public verify(callback: (value: T) => any, times: Times): void { - const expectation = capture(callback); + public verify(callback: (value: T) => U, times: Times, message?: string): void { + const expectation = this.capture(callback, /*result*/ undefined); let count: number = 0; for (const recording of this.recordings) { @@ -280,7 +422,7 @@ class MockHandler implements ProxyHandler { } } - times.check(count, `An error occured when verifying expectation: ${expectation}`); + times.check(count, message || `An error occured when verifying expectation: ${expectation}`); } public getTarget(target: T, name: PropertyKey) { @@ -307,28 +449,80 @@ class MockHandler implements ProxyHandler { } } + protected capture(callback: (value: T) => U, result: Setup | undefined) { + return this.captureCore(empty, new CapturingHandler(result), callback); + } + + protected captureCore(target: T, handler: CapturingHandler, callback: (value: T) => U): Recording { + const { proxy, revoke } = Proxy.revocable(target, handler); + try { + callback(proxy); + if (!handler.recording) { + throw new Error("Nothing was captured."); + } + return handler.recording; + } + finally { + revoke(); + } + } + private defineMethod(name: PropertyKey) { - const setups = this.memberSetups; + const setups = this.setups; this.setupMembers({ - [name](...args: any[]) { - return Setup.evaluate(setups.get(name), "invoke", args); + [name](...argArray: any[]) { + return Recording.evaluate(setups, "invoke", name, this, argArray, /*newTarget*/ undefined, noop); } }); } private defineAccessor(name: PropertyKey) { - const setups = this.memberSetups; + const setups = this.setups; this.setupMembers({ get [name]() { - return Setup.evaluate(setups.get(name), "get", []); + return Recording.evaluate(setups, "get", name, this, [], /*newTarget*/ undefined, noop); }, set [name](value: any) { - Setup.evaluate(setups.get(name), "set", [value]); + Recording.evaluate(setups, "set", name, this, [value], /*newTarget*/ undefined, noop); } }); } } +class MockFunctionHandler extends MockHandler { + public apply(target: T, thisArg: any, argArray: any[]): any { + const setups = Recording.select(this.setups, "function", /*name*/ undefined); + const result: Partial & Throws> = {}; + const recording = new Recording("apply", /*name*/ undefined, thisArg, argArray, /*newTarget*/ undefined, result, /*callback*/ undefined); + this.recordings.push(recording); + try { + return Recording.evaluate(setups, "apply", /*name*/ undefined, thisArg, argArray, /*newTarget*/ undefined, + () => Reflect.apply(target, thisArg, argArray)); + } + catch (e) { + throw result.throw = e; + } + } + + public construct(target: T, argArray: any[], newTarget?: any): any { + const setups = Recording.select(this.setups, "function", /*name*/ undefined); + const result: Partial & Throws> = {}; + const recording = new Recording("construct", /*name*/ undefined, /*thisArg*/ undefined, argArray, newTarget, result, /*callback*/ undefined); + this.recordings.push(recording); + try { + return Recording.evaluate(setups, "construct", /*name*/ undefined, /*thisArg*/ undefined, argArray, newTarget, + () => Reflect.construct(target, argArray, newTarget)); + } + catch (e) { + throw result.throw = e; + } + } + + protected capture(callback: (value: T) => U, result: Returns & ThisArg | Returns | Throws & ThisArg | Throws | ThisArg | undefined) { + return this.captureCore(noop, new CapturingFunctionHandler(result), callback); + } +} + class MethodHandler { public name: PropertyKey; @@ -337,58 +531,53 @@ class MethodHandler { } public apply(target: Function, thisArgument: any, argumentsList: any[]): any { - const handler = getHandler(thisArgument); + const handler = weakHandler.get(thisArgument); return handler ? handler.invoke(thisArgument, this.name, target, argumentsList) : Reflect.apply(target, thisArgument, argumentsList); } } -class CapturingHandler { +class CapturingHandler implements ProxyHandler { public recording: Recording | undefined; - private _name: PropertyKey; - private _method: Function; + protected readonly callback: Callable | undefined; + protected readonly thisArg: any; + protected readonly result: Returns | Throws | Fallback | undefined; - constructor() { - this._method = (...args: any[]) => { - this.recording = new Recording("invoke", this._name, args); - }; + constructor(result: Partial & Throws & ThisArg & Callback & Fallback> | undefined) { + this.thisArg = hasOwn(result, "this") ? result.this : Recording.noThisArg; + this.callback = hasOwn(result, "callback") ? result.callback : undefined; + this.result = hasOwn(result, "return") ? { return: result.return } : + hasOwn(result, "throw") ? { throw: result.throw } : + hasOwn(result, "fallback") && result.fallback ? { fallback: true } : + undefined; } - public apply(_target: object, _thisArg: any, argArray: any[]): any { - this.recording = new Recording("apply", /*name*/ undefined, argArray); - return undefined; + public get(_target: T, name: PropertyKey, _receiver: any): any { + this.recording = new Recording("get", name, this.thisArg, [], /*newTarget*/ undefined, this.result, this.callback); + return (...argArray: any[]) => { this.recording = new Recording("invoke", name, this.thisArg, argArray, /*newTarget*/ undefined, this.result, this.callback); }; } - public construct(_target: object, argArray: any[], newTarget?: any): any { - this.recording = new Recording("construct", /*name*/ undefined, argArray, newTarget); - return undefined; + public set(_target: T, name: PropertyKey, value: any, _receiver: any): boolean { + this.recording = new Recording("set", name, this.thisArg, [value], /*newTarget*/ undefined, this.result, this.callback); + return true; } +} - public get(_target: object, name: PropertyKey, _receiver: any): any { - this.recording = new Recording("get", name, []); - this._name = name; - return this._method; +class CapturingFunctionHandler extends CapturingHandler { + public apply(_target: T, _thisArg: any, argArray: any[]): any { + this.recording = new Recording("apply", /*name*/ undefined, this.thisArg, argArray, /*newTarget*/ undefined, this.result, this.callback); + return undefined; } - public set(_target: object, name: PropertyKey, value: any, _receiver: any): boolean { - this.recording = new Recording("set", name, [value]); - return true; + public construct(_target: T, argArray: any[], newTarget?: any): any { + this.recording = new Recording("construct", /*name*/ undefined, /*thisArg*/ undefined, argArray, newTarget, this.result, this.callback); + return undefined; } } -function capture(callback: (value: T) => U): Recording { - const handler = new CapturingHandler(); - const { proxy, revoke } = Proxy.revocable(noop, handler); - try { - callback(proxy); - if (!handler.recording) { - throw new Error("Nothing was captured."); - } - return handler.recording; - } - finally { - revoke(); - } +function hasOwn(object: Partial | undefined, key: K): object is (T | T & never) & { [P in K]: T[P] } { + return object !== undefined + && Object.prototype.hasOwnProperty.call(object, key); } \ No newline at end of file diff --git a/scripts/typemock/src/spy.ts b/scripts/typemock/src/spy.ts deleted file mode 100644 index 2bb21e6e21d8b..0000000000000 --- a/scripts/typemock/src/spy.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { Mock } from "./mock"; -import { Times } from "./times"; -import { Arg } from "./arg"; - -function noop() {} - -export type Callable = ((...args: any[]) => any); - -export type Constructable = (new (...args: any[]) => any); - -export class Spy { - private _mock: Mock; - - constructor(target = noop) { - this._mock = new Mock(target); - } - - public get value(): T { - return this._mock.value; - } - - public verify(callback: (value: T) => any, times: Times): this { - this._mock.verify(callback, times); - return this; - } - - public called(times: Times): this { - return this.verify(_ => (_)(Arg.rest()), times); - } - - public constructed(times: Times): this { - return this.verify(_ => new (_)(Arg.rest()), times); - } - - public revoke(): void { - this._mock.revoke(); - } -} diff --git a/scripts/typemock/src/tests/argTests.ts b/scripts/typemock/src/tests/argTests.ts index 1203097ec5c52..03d96f1c469ab 100644 --- a/scripts/typemock/src/tests/argTests.ts +++ b/scripts/typemock/src/tests/argTests.ts @@ -9,11 +9,10 @@ describe("arg", () => { const target = Arg.from(Arg.any()); // act - const result = Arg.validate(target, ["a"], 0); + const result = Arg.validate(target, "a"); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("toString", () => { // arrange @@ -32,21 +31,20 @@ describe("arg", () => { const target = Arg.from(Arg.is(value => value === "a")); // act - const result = Arg.validate(target, ["a"], 0); + const result = Arg.validate(target, "a"); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.is(value => value === "a")); // act - const result = Arg.validate(target, ["b"], 0); + const result = Arg.validate(target, "b"); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -65,21 +63,20 @@ describe("arg", () => { const target = Arg.from(Arg.notNull()); // act - const result = Arg.validate(target, [{}], 0); + const result = Arg.validate(target, {}); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.notNull()); // act - const result = Arg.validate(target, [null], 0); + const result = Arg.validate(target, null); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -98,21 +95,20 @@ describe("arg", () => { const target = Arg.from(Arg.null()); // act - const result = Arg.validate(target, [null], 0); + const result = Arg.validate(target, null); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.null()); // act - const result = Arg.validate(target, [{}], 0); + const result = Arg.validate(target, {}); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -131,21 +127,20 @@ describe("arg", () => { const target = Arg.from(Arg.notUndefined()); // act - const result = Arg.validate(target, [{}], 0); + const result = Arg.validate(target, {}); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.notUndefined()); // act - const result = Arg.validate(target, [undefined], 0); + const result = Arg.validate(target, undefined); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -164,21 +159,20 @@ describe("arg", () => { const target = Arg.from(Arg.undefined()); // act - const result = Arg.validate(target, [undefined], 0); + const result = Arg.validate(target, undefined); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.undefined()); // act - const result = Arg.validate(target, [{}], 0); + const result = Arg.validate(target, {}); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -197,31 +191,30 @@ describe("arg", () => { const target = Arg.from(Arg.notNullOrUndefined()); // act - const result = Arg.validate(target, [{}], 0); + const result = Arg.validate(target, {}); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("invalid (null)", () => { // arrange const target = Arg.from(Arg.notNullOrUndefined()); // act - const result = Arg.validate(target, [null], 0); + const result = Arg.validate(target, null); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("invalid (undefined)", () => { // arrange const target = Arg.from(Arg.notNullOrUndefined()); // act - const result = Arg.validate(target, [undefined], 0); + const result = Arg.validate(target, undefined); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -240,32 +233,30 @@ describe("arg", () => { const target = Arg.from(Arg.nullOrUndefined()); // act - const result = Arg.validate(target, [null], 0); + const result = Arg.validate(target, null); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("valid (undefined)", () => { // arrange const target = Arg.from(Arg.nullOrUndefined()); // act - const result = Arg.validate(target, [undefined], 0); + const result = Arg.validate(target, undefined); // assert - assert.isTrue(result.valid); - assert.strictEqual(result.next, 1); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.nullOrUndefined()); // act - const result = Arg.validate(target, [{}], 0); + const result = Arg.validate(target, {}); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -284,26 +275,26 @@ describe("arg", () => { const target = Arg.from(Arg.between(1, 3)); // act - const min = Arg.validate(target, [1], 0); - const mid = Arg.validate(target, [2], 0); - const max = Arg.validate(target, [3], 0); + const min = Arg.validate(target, 1); + const mid = Arg.validate(target, 2); + const max = Arg.validate(target, 3); // assert - assert.isTrue(min.valid); - assert.isTrue(mid.valid); - assert.isTrue(max.valid); + assert.isTrue(min); + assert.isTrue(mid); + assert.isTrue(max); }); it("invalid", () => { // arrange const target = Arg.from(Arg.between(1, 3)); // act - const before = Arg.validate(target, [0], 0); - const after = Arg.validate(target, [4], 0); + const before = Arg.validate(target, 0); + const after = Arg.validate(target, 4); // assert - assert.isFalse(before.valid); - assert.isFalse(after.valid); + assert.isFalse(before); + assert.isFalse(after); }); it("toString", () => { // arrange @@ -322,20 +313,20 @@ describe("arg", () => { const target = Arg.from(Arg.in(["a", "b"])); // act - const result = Arg.validate(target, ["a"], 0); + const result = Arg.validate(target, "a"); // assert - assert.isTrue(result.valid); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.in(["a", "b"])); // act - const result = Arg.validate(target, ["c"], 0); + const result = Arg.validate(target, "c"); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -354,20 +345,20 @@ describe("arg", () => { const target = Arg.from(Arg.notIn(["a", "b"])); // act - const result = Arg.validate(target, ["c"], 0); + const result = Arg.validate(target, "c"); // assert - assert.isTrue(result.valid); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.notIn(["a", "b"])); // act - const result = Arg.validate(target, ["a"], 0); + const result = Arg.validate(target, "a"); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -386,20 +377,20 @@ describe("arg", () => { const target = Arg.from(Arg.match(/^a$/)); // act - const result = Arg.validate(target, ["a"], 0); + const result = Arg.validate(target, "a"); // assert - assert.isTrue(result.valid); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.match(/^a$/)); // act - const result = Arg.validate(target, ["b"], 0); + const result = Arg.validate(target, "b"); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -418,20 +409,20 @@ describe("arg", () => { const target = Arg.from(Arg.typeof("number")); // act - const result = Arg.validate(target, [1], 0); + const result = Arg.validate(target, 1); // assert - assert.isTrue(result.valid); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from(Arg.typeof("number")); // act - const result = Arg.validate(target, ["a"], 0); + const result = Arg.validate(target, "a"); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -451,10 +442,10 @@ describe("arg", () => { const target = Arg.from(Arg.instanceof(C)); // act - const result = Arg.validate(target, [new C()], 0); + const result = Arg.validate(target, new C()); // assert - assert.isTrue(result.valid); + assert.isTrue(result); }); it("invalid", () => { // arrange @@ -462,10 +453,10 @@ describe("arg", () => { const target = Arg.from(Arg.instanceof(C)); // act - const result = Arg.validate(target, [{}], 0); + const result = Arg.validate(target, {}); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -485,22 +476,22 @@ describe("arg", () => { const target = Arg.from(Arg.has("a")); // act - const own = Arg.validate(target, [{ a: 1 }], 0); - const proto = Arg.validate(target, [{ __proto__: { a: 1 } }], 0); + const own = Arg.validate(target, { a: 1 }); + const proto = Arg.validate(target, { __proto__: { a: 1 } }); // assert - assert.isTrue(own.valid); - assert.isTrue(proto.valid); + assert.isTrue(own); + assert.isTrue(proto); }); it("invalid", () => { // arrange const target = Arg.from(Arg.has("a")); // act - const result = Arg.validate(target, [{ b: 1 }], 0); + const result = Arg.validate(target, { b: 1 }); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -519,22 +510,22 @@ describe("arg", () => { const target = Arg.from(Arg.hasOwn("a")); // act - const own = Arg.validate(target, [{ a: 1 }], 0); + const own = Arg.validate(target, { a: 1 }); // assert - assert.isTrue(own.valid); + assert.isTrue(own); }); it("invalid", () => { // arrange const target = Arg.from(Arg.hasOwn("a")); // act - const result = Arg.validate(target, [{ b: 1 }], 0); - const proto = Arg.validate(target, [{ __proto__: { a: 1 } }], 0); + const result = Arg.validate(target, { b: 1 }); + const proto = Arg.validate(target, { __proto__: { a: 1 } }); // assert - assert.isFalse(result.valid); - assert.isFalse(proto.valid); + assert.isFalse(result); + assert.isFalse(proto); }); it("toString", () => { // arrange @@ -554,14 +545,12 @@ describe("arg", () => { const target = Arg.from(Arg.rest()); // act - const empty = Arg.validate(target, [], 0); - const multiple = Arg.validate(target, ["a", "b"], 0); + const empty = Arg.validateAll([target], []); + const multiple = Arg.validateAll([target], ["a", "b"]); // assert - assert.isTrue(empty.valid); - assert.strictEqual(empty.next, 0); - assert.isTrue(multiple.valid); - assert.strictEqual(multiple.next, 2); + assert.isTrue(empty); + assert.isTrue(multiple); }); it("toString", () => { // arrange @@ -580,24 +569,22 @@ describe("arg", () => { const target = Arg.from(Arg.rest(Arg.typeof("string"))); // act - const empty = Arg.validate(target, [], 0); - const multiple = Arg.validate(target, ["a", "b"], 0); + const empty = Arg.validateAll([target], []); + const multiple = Arg.validateAll([target], ["a", "b"]); // assert - assert.isTrue(empty.valid); - assert.strictEqual(empty.next, 0); - assert.isTrue(multiple.valid); - assert.strictEqual(multiple.next, 2); + assert.isTrue(empty); + assert.isTrue(multiple); }); it("invalid", () => { // arrange const target = Arg.from(Arg.rest(Arg.typeof("string"))); // act - const result = Arg.validate(target, ["a", 1], 0); + const result = Arg.validateAll([target], ["a", 1]); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange @@ -617,20 +604,20 @@ describe("arg", () => { const target = Arg.from("a"); // act - const result = Arg.validate(target, ["a"], 0); + const result = Arg.validate(target, "a"); // assert - assert.isTrue(result.valid); + assert.isTrue(result); }); it("invalid", () => { // arrange const target = Arg.from("a"); // act - const result = Arg.validate(target, ["b"], 0); + const result = Arg.validate(target, "b"); // assert - assert.isFalse(result.valid); + assert.isFalse(result); }); it("toString", () => { // arrange diff --git a/scripts/typemock/src/tests/index.ts b/scripts/typemock/src/tests/index.ts index 45a2246e28619..1ff30bfad40d3 100644 --- a/scripts/typemock/src/tests/index.ts +++ b/scripts/typemock/src/tests/index.ts @@ -1,5 +1,5 @@ import "./argTests"; import "./timesTests"; import "./mockTests"; -import "./stubTests"; +import "./injectTests"; import "./timersTests"; \ No newline at end of file diff --git a/scripts/typemock/src/tests/injectTests.ts b/scripts/typemock/src/tests/injectTests.ts new file mode 100644 index 0000000000000..c7aa747e31426 --- /dev/null +++ b/scripts/typemock/src/tests/injectTests.ts @@ -0,0 +1,79 @@ +import "./sourceMapSupport"; +import { Mock } from "../mock"; +import { Inject } from "../inject"; +import { Times } from "../times"; +import { assert } from "chai"; + +describe("inject", () => { + it("install replaces value", () => { + // arrange + const mock = new Mock({ a: 1 }); + const inject = new Inject(mock.proxy, "a", 2); + + // act + inject.install(); + + // assert + mock.verify(_ => _.a = 2, Times.once()); + }); + it("install is installed", () => { + // arrange + const mock = new Mock({ a: 1 }); + const inject = new Inject(mock.proxy, "a", 2); + + // act + inject.install(); + + // assert + assert.isTrue(inject.installed); + }); + it("install twice only installs once", () => { + // arrange + const mock = new Mock({ a: 1 }); + const inject = new Inject(mock.proxy, "a", 2); + + // act + inject.install(); + inject.install(); + + // assert + mock.verify(_ => _.a = 2, Times.once()); + }); + it("uninstall restores value", () => { + // arrange + const mock = new Mock({ a: 1 }); + const inject = new Inject(mock.proxy, "a", 2); + inject.install(); + + // act + inject.uninstall(); + + // assert + mock.verify(_ => _.a = 1, Times.once()); + }); + it("uninstall is not installed", () => { + // arrange + const mock = new Mock({ a: 1 }); + const inject = new Inject(mock.proxy, "a", 2); + inject.install(); + + // act + inject.uninstall(); + + // assert + assert.isFalse(inject.installed); + }); + it("uninstall twice only uninstalls once", () => { + // arrange + const mock = new Mock({ a: 1 }); + const inject = new Inject(mock.proxy, "a", 2); + inject.install(); + + // act + inject.uninstall(); + inject.uninstall(); + + // assert + mock.verify(_ => _.a = 1, Times.once()); + }); +}); diff --git a/scripts/typemock/src/tests/mockTests.ts b/scripts/typemock/src/tests/mockTests.ts index 38efbdb04c782..f461c289c8531 100644 --- a/scripts/typemock/src/tests/mockTests.ts +++ b/scripts/typemock/src/tests/mockTests.ts @@ -1,262 +1,363 @@ import "./sourceMapSupport"; import { Mock } from "../mock"; -import { Stub } from "../stub"; +import { Inject } from "../inject"; import { Arg } from "../arg"; import { Times } from "../times"; import { recordError } from "./utils"; import { assert } from "chai"; describe("mock", () => { - it("mock get with no setups", () => { - // arrange - const target = { a: 1 }; - const mock = new Mock(target); + describe("no setup", () => { + it("get (exists)", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); - // act - const result = mock.value.a; + // act + const result = mock.proxy.a; - // assert - assert.equal(1, result); - }); - it("mock setup property get with return", () => { - // arrange - const target = { a: 1 }; - const mock = new Mock(target, { get a() { return 2; } }); - - // act - const result = mock.value.a; - - // assert - assert.equal(2, result); - }); - it("mock setup property get with throw", () => { - // arrange - const target = { a: 1 }; - const error = new Error("error"); - const mock = new Mock(target, { get a(): number { throw error; } }); - - // act - const e = recordError(() => mock.value.a); - - // assert - assert.strictEqual(error, e); - }); - it("mock setup property set", () => { - // arrange - let _a: number | undefined; - const target = { a: 1 }; - const mock = new Mock(target, { set a(value: number) { _a = value; } }); - - // act - mock.value.a = 2; - - // assert - assert.equal(2, _a); - assert.equal(1, target.a); - }); - it("mock setup property set with throw", () => { - // arrange - const target = { a: 1 }; - const error = new Error("error"); - const mock = new Mock(target, { set a(value: number) { throw error; } }); - - // act - const e = recordError(() => mock.value.a = 2); - - // assert - assert.strictEqual(error, e); - }); - it("mock setup method call no setups", () => { - // arrange - const target = { a() { return 1; } }; - const mock = new Mock(target); - - // act - const result = mock.value.a(); - - // assert - assert.equal(1, result); - }); - it("mock setup method callback", () => { - // arrange - const target = { a() { return 1; } }; - const mock = new Mock(target, { a() { return 2; } }); - - // act - const result = mock.value.a(); - - // assert - assert.equal(2, result); - }); - it("mock setup method callback throws", () => { - // arrange - const target = { a() { return 1; } }; - const error = new Error("error"); - const mock = new Mock(target, { a(): number { throw error; } }); - - // act - const e = recordError(() => mock.value.a()); - - // assert - assert.strictEqual(error, e); - }); - it("mock setup new property", () => { - // arrange - const target = { a: 1 }; - const mock = new Mock(target, { b: 2 }); - - // act - const result = (mock.value).b; - - // assert - assert.equal(2, result); - }); - it("mock setup new method", () => { - // arrange - const target = { a: 1 }; - const mock = new Mock(target, { b() { return 2; } }); - - // act - const result = (mock.value).b(); - - // assert - assert.equal(2, result); - }); - it("mock verify get no setups, not called throws", () => { - // arrange - const target = { a: 1 }; - const mock = new Mock(target); + // assert + assert.equal(result, 1); + }); + it("get (missing)", () => { + // arrange + const mock = new Mock<{ a?: number }>(); - // act - const e = recordError(() => mock.verify(_ => _.a, Times.once())); + // act + const result = mock.proxy.a; - // assert - assert.instanceOf(e, Error); - }); - it("mock verify get no setups, called passes", () => { - // arrange - const target = { a: 1 }; - const mock = new Mock(target); - const result = mock.value.a; + // assert + assert.isUndefined(result); + }); + it("set (exists)", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); - // act - const e = recordError(() => mock.verify(_ => _.a, Times.once())); + // act + mock.proxy.a = 2; + const result = mock.proxy.a; - // assert - assert.isUndefined(e); - }); - it("mock verify setup get, called passes", () => { - // arrange - const target = { a: 1 }; - const mock = new Mock(target, { get a() { return 2 } }); - const result = mock.value.a; + // assert + assert.equal(result, 2); + }); + it("set (missing)", () => { + // arrange + const mock = new Mock<{ a?: number }>(); - // act - const e = recordError(() => mock.verify(_ => _.a, Times.once())); + // act + mock.proxy.a = 2; + const result = mock.proxy.a; - // assert - assert.isUndefined(e); - }); - it("mock verify method no setups, not called throws", () => { - // arrange - const target = { a() { return 1; } }; - const mock = new Mock(target); + // assert + assert.equal(result, 2); + }); + it("method (existing)", () => { + // arrange + const target = { a() { return 1; } }; + const mock = new Mock(target); - // act - const e = recordError(() => mock.verify(_ => _.a(), Times.once())); + // act + const result = mock.proxy.a(); - // assert - assert.instanceOf(e, Error); + // assert + assert.equal(1, result); + }); }); - it("mock verify method no setups, called passes", () => { - // arrange - const target = { a() { return 1; } }; - const mock = new Mock(target); - const result = mock.value.a(); - - // act - const e = recordError(() => mock.verify(_ => _.a(), Times.once())); - // assert - assert.isUndefined(e); - }); - it("mock verify setup method, called passes", () => { - // arrange - const target = { a(x: number) { return x + 1; } }; - const mock = new Mock(target, { - a(x: number) { - return x + 2; - } + describe("setup", () => { + describe("using object", () => { + it("get", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target, { get a() { return 2; } }); + + // act + const result = mock.proxy.a; + + // assert + assert.equal(2, result); + }); + it("get with throw", () => { + // arrange + const target = { a: 1 }; + const error = new Error("error"); + const mock = new Mock(target, { get a(): number { throw error; } }); + + // act + const e = recordError(() => mock.proxy.a); + + // assert + assert.strictEqual(error, e); + }); + it("set", () => { + // arrange + let _a: number | undefined; + const target = { a: 1 }; + const mock = new Mock(target, { set a(value: number) { _a = value; } }); + + // act + mock.proxy.a = 2; + + // assert + assert.equal(2, _a); + assert.equal(1, target.a); + }); + it("set with throw", () => { + // arrange + const target = { a: 1 }; + const error = new Error("error"); + const mock = new Mock(target, { set a(value: number) { throw error; } }); + + // act + const e = recordError(() => mock.proxy.a = 2); + + // assert + assert.strictEqual(error, e); + }); + it("method", () => { + // arrange + const target = { a() { return 1; } }; + const mock = new Mock(target, { a() { return 2; } }); + + // act + const result = mock.proxy.a(); + + // assert + assert.equal(2, result); + }); + it("method throws", () => { + // arrange + const target = { a() { return 1; } }; + const error = new Error("error"); + const mock = new Mock(target, { a(): number { throw error; } }); + + // act + const e = recordError(() => mock.proxy.a()); + + // assert + assert.strictEqual(error, e); + }); + it("new property", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target, { b: 2 }); + + // act + const result = (mock.proxy).b; + + // assert + assert.equal(2, result); + }); + it("new method", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target, { b() { return 2; } }); + + // act + const result = (mock.proxy).b(); + + // assert + assert.equal(2, result); + }); + }); + describe("using callback", () => { + it("get only", () => { + // arrange + const mock = new Mock<{ a: number }>(); + mock.setup(_ => _.a, { return: 2 }); + + // act + const result1 = mock.proxy.a; + const err = recordError(() => mock.proxy.a = 3); + const result2 = mock.proxy.a; + + // assert + assert.strictEqual(result1, 2); + assert.strictEqual(result2, 2); + assert.instanceOf(err, Error); + }); + it("set only", () => { + // arrange + const mock = new Mock<{ a: number }>(); + mock.setup(_ => _.a = 2); + + // act + const result = mock.proxy.a; + const err2 = recordError(() => mock.proxy.a = 2); + const err3 = recordError(() => mock.proxy.a = 3); + + // assert + assert.isUndefined(result); + assert.isUndefined(err2); + assert.instanceOf(err3, Error); + }); + it("get and set", () => { + // arrange + const mock = new Mock<{ a: number }>(); + mock.setup(_ => _.a, { return: 2 }); + mock.setup(_ => _.a = Arg.any()); + + // act + const result = mock.proxy.a; + mock.proxy.a = 3; + + // assert + assert.strictEqual(result, 2); + }); + it("method", () => { + // arrange + const mock = new Mock<{ a(x: number): number; }>(); + mock.setup(_ => _.a(1), { return: 2 }); + + // act + const result = mock.proxy.a(1); + + // assert + assert.strictEqual(result, 2); + }); + it("function", () => { + // arrange + const mock = new Mock<(x: number) => number>(x => 0); + mock.setup(_ => _(Arg.number()), { return: 2 }); + + // act + const result = mock.proxy(1); + + // assert + assert.strictEqual(result, 2); + }); }); - const result = mock.value.a(3); - - // act - const e = recordError(() => mock.verify(_ => _.a(Arg.number()), Times.once())); - - // assert - assert.isUndefined(e); }); - it("mock setup method using callback", () => { - // arrange - const mock = new Mock<{ a(x: number): number; }>(); - mock.setup(_ => _.a(1), { returns: 2 }); - // act - const result = mock.value.a(1); - - // assert - assert.strictEqual(result, 2); - }); - it("mock setup setter/getter using callback", () => { - // arrange - const mock = new Mock<{ a: number }>(); - mock.setup(_ => _.a, { returns: 2 }); - mock.setup(_ => _.a = Arg.any()); - - // act - const result = mock.value.a; - mock.value.a = 3; - - // assert - assert.strictEqual(result, 2); - }); - it("mock setup getter only using callback", () => { - // arrange - const mock = new Mock<{ a: number }>(); - mock.setup(_ => _.a, { returns: 2 }); - - // act - const result = mock.value.a; - const err = recordError(() => mock.value.a = 3); - - // assert - assert.strictEqual(result, 2); - assert.instanceOf(err, Error); - }); - it("mock setup setter only using callback", () => { - // arrange - const mock = new Mock<{ a: number }>(); - mock.setup(_ => _.a = 2); - - // act - const err1 = recordError(() => mock.value.a); - const err2 = recordError(() => mock.value.a = 2); - const err3 = recordError(() => mock.value.a = 3); - - // assert - assert.instanceOf(err1, Error); - assert.isUndefined(err2); - assert.instanceOf(err3, Error); - }); - it("mock setup function only using callback", () => { - // arrange - const mock = new Mock<(x: number) => number>(x => 0); - mock.setup(_ => _(Arg.number()), { returns: 2 }); + describe("verify", () => { + describe("no setup", () => { + describe("get", () => { + it("not called throws", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); + + // act + const e = recordError(() => mock.verify(_ => _.a, Times.once())); + + // assert + assert.instanceOf(e, Error); + }); + it("called passes", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); + const result = mock.proxy.a; + + // act + const e = recordError(() => mock.verify(_ => _.a, Times.once())); + + // assert + assert.isUndefined(e); + }); + }); + describe("set", () => { + it("not called throws", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); + + // act + const e = recordError(() => mock.verify(_ => _.a = 2, Times.once())); + + // assert + assert.instanceOf(e, Error); + }); + it("called passes", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target); + mock.proxy.a = 2; + + // act + const e = recordError(() => mock.verify(_ => _.a = 2, Times.once())); + + // assert + assert.isUndefined(e); + }); + }); + describe("method", () => { + it("not called throws", () => { + // arrange + const target = { a() { return 1; } }; + const mock = new Mock(target); + + // act + const e = recordError(() => mock.verify(_ => _.a(), Times.once())); + + // assert + assert.instanceOf(e, Error); + }); + it("called passes", () => { + // arrange + const target = { a() { return 1; } }; + const mock = new Mock(target); + const result = mock.proxy.a(); + + // act + const e = recordError(() => mock.verify(_ => _.a(), Times.once())); + + // assert + assert.isUndefined(e); + }); + }); + describe("function", () => { + it("not called throws", () => { + // arrange + const mock = Mock.function(); + + // act + const e = recordError(() => mock.verify(_ => _(), Times.once())); + + // assert + assert.instanceOf(e, Error); + }); + it("called passes", () => { + // arrange + const mock = Mock.function(); + const result = mock.proxy(); + + // act + const e = recordError(() => mock.verify(_ => _(), Times.once())); + + // assert + assert.isUndefined(e); + }); + }); + }); + it("setup get, called passes", () => { + // arrange + const target = { a: 1 }; + const mock = new Mock(target, { get a() { return 2 } }); + const result = mock.proxy.a; - // act - const result = mock.value(1); + // act + const e = recordError(() => mock.verify(_ => _.a, Times.once())); - // assert - assert.strictEqual(result, 2); + // assert + assert.isUndefined(e); + }); + it("setup method, called passes", () => { + // arrange + const target = { a(x: number) { return x + 1; } }; + const mock = new Mock(target, { + a(x: number) { + return x + 2; + } + }); + const result = mock.proxy.a(3); + + // act + const e = recordError(() => mock.verify(_ => _.a(Arg.number()), Times.once())); + + // assert + assert.isUndefined(e); + }); }); }); \ No newline at end of file diff --git a/scripts/typemock/src/tests/stubTests.ts b/scripts/typemock/src/tests/stubTests.ts deleted file mode 100644 index 53ea8da20c777..0000000000000 --- a/scripts/typemock/src/tests/stubTests.ts +++ /dev/null @@ -1,79 +0,0 @@ -import "./sourceMapSupport"; -import { Mock } from "../mock"; -import { Stub } from "../stub"; -import { Times } from "../times"; -import { assert } from "chai"; - -describe("stub", () => { - it("stub install replaces value", () => { - // arrange - const mock = new Mock({ a: 1 }); - const stub = new Stub(mock.value, "a", 2); - - // act - stub.install(); - - // assert - mock.verify(_ => _.a = 2, Times.once()); - }); - it("stub install is installed", () => { - // arrange - const mock = new Mock({ a: 1 }); - const stub = new Stub(mock.value, "a", 2); - - // act - stub.install(); - - // assert - assert.isTrue(stub.installed); - }); - it("stub install twice only installs once", () => { - // arrange - const mock = new Mock({ a: 1 }); - const stub = new Stub(mock.value, "a", 2); - - // act - stub.install(); - stub.install(); - - // assert - mock.verify(_ => _.a = 2, Times.once()); - }); - it("stub uninstall restores value", () => { - // arrange - const mock = new Mock({ a: 1 }); - const stub = new Stub(mock.value, "a", 2); - stub.install(); - - // act - stub.uninstall(); - - // assert - mock.verify(_ => _.a = 1, Times.once()); - }); - it("stub uninstall is not installed", () => { - // arrange - const mock = new Mock({ a: 1 }); - const stub = new Stub(mock.value, "a", 2); - stub.install(); - - // act - stub.uninstall(); - - // assert - assert.isFalse(stub.installed); - }); - it("stub uninstall twice only uninstalls once", () => { - // arrange - const mock = new Mock({ a: 1 }); - const stub = new Stub(mock.value, "a", 2); - stub.install(); - - // act - stub.uninstall(); - stub.uninstall(); - - // assert - mock.verify(_ => _.a = 1, Times.once()); - }); -}); diff --git a/scripts/typemock/src/tests/timersTests.ts b/scripts/typemock/src/tests/timersTests.ts index 5d3b9d7917a27..15c8161faccea 100644 --- a/scripts/typemock/src/tests/timersTests.ts +++ b/scripts/typemock/src/tests/timersTests.ts @@ -1,5 +1,5 @@ import "./sourceMapSupport"; -import { Spy } from "../spy"; +import { Mock } from "../mock"; import { Arg } from "../arg"; import { Times } from "../times"; import { Timers } from "../timers"; @@ -10,52 +10,52 @@ describe("timers", () => { it("set adds entry, does not invoke", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - const handle = target.setImmediate(spy.value); + const handle = target.setImmediate(spy.proxy); const pending = target.getPending(); // assert assert.strictEqual(pending.length, 1); assert.strictEqual(pending[0].kind, "immediate"); assert.isDefined(handle); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("set/clear", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - const handle = target.setImmediate(spy.value); + const handle = target.setImmediate(spy.proxy); target.clearImmedate(handle); const pending = target.getPending(); // assert assert.strictEqual(pending.length, 0); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("set one and execute", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.setImmediate(spy.value); + target.setImmediate(spy.proxy); const count = target.executeImmediates(); // assert assert.strictEqual(count, 1); - spy.called(Times.once()); + spy.verify(_ => _(), Times.once()); }); it("set one with arg and execute", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.setImmediate(spy.value, "a"); + target.setImmediate(spy.proxy, "a"); const count = target.executeImmediates(); // assert @@ -65,108 +65,108 @@ describe("timers", () => { it("nested with maxDepth = 0", () => { // arrange const target = new Timers(); - const spy = new Spy(() => { target.setImmediate(spy.value); }); + const spy = Mock.spy(() => { target.setImmediate(spy.proxy); }); // act - target.setImmediate(spy.value); + target.setImmediate(spy.proxy); const count = target.executeImmediates(/*maxDepth*/ 0); // assert assert.strictEqual(count, 1); - spy.called(Times.once()); + spy.verify(_ => _(), Times.once()); }); it("nested with maxDepth = 1", () => { // arrange const target = new Timers(); - const spy = new Spy(() => { target.setImmediate(spy.value); }); + const spy = Mock.spy(() => { target.setImmediate(spy.proxy); }); // act - target.setImmediate(spy.value); + target.setImmediate(spy.proxy); const count = target.executeImmediates(/*maxDepth*/ 1); // assert assert.strictEqual(count, 2); - spy.called(Times.exactly(2)); + spy.verify(_ => _(), Times.exactly(2)); }); }); describe("timeout", () => { it("set adds entry, does not invoke", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - const handle = target.setTimeout(spy.value, 0); + const handle = target.setTimeout(spy.proxy, 0); const pending = target.getPending(); // assert assert.strictEqual(pending.length, 1); assert.strictEqual(pending[0].kind, "timeout"); assert.isDefined(handle); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("set/clear", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - const handle = target.setTimeout(spy.value, 0); + const handle = target.setTimeout(spy.proxy, 0); target.clearTimeout(handle); const pending = target.getPending(); // assert assert.strictEqual(pending.length, 0); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("set adds future entry, advance prior to due does not invoke", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.setTimeout(spy.value, 10); + target.setTimeout(spy.proxy, 10); const count = target.advance(9); // assert assert.strictEqual(count, 0); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("set adds future entry, advance to due invokes", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.setTimeout(spy.value, 10); + target.setTimeout(spy.proxy, 10); const count = target.advance(10); // assert assert.strictEqual(count, 1); - spy.called(Times.once()); + spy.verify(_ => _(), Times.once()); }); it("5 nested sets throttle", () => { // arrange const target = new Timers(); - const spy = new Spy(() => { target.setTimeout(spy.value, 0); }); + const spy = new Mock(() => { target.setTimeout(spy.proxy, 0); }); // act - target.setTimeout(spy.value, 0); + target.setTimeout(spy.proxy, 0); const count = target.advance(1); // assert assert.strictEqual(count, 5); - spy.called(Times.exactly(5)); + spy.verify(_ => _(), Times.exactly(5)); }); }); describe("interval", () => { it("set adds entry, does not invoke", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - const handle = target.setInterval(spy.value, 0); + const handle = target.setInterval(spy.proxy, 0); const pending = target.getPending({ kind: "interval", ms: 10 }); // assert @@ -174,132 +174,132 @@ describe("timers", () => { assert.strictEqual(pending[0].kind, "interval"); assert.strictEqual(pending[0].interval, 10); assert.isDefined(handle); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("set/clear", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - const handle = target.setInterval(spy.value, 0); + const handle = target.setInterval(spy.proxy, 0); target.clearInterval(handle); const pending = target.getPending({ kind: "interval", ms: 10 }); // assert assert.strictEqual(pending.length, 0); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("set adds future entry, advance prior to due does not invoke", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.setInterval(spy.value, 10); + target.setInterval(spy.proxy, 10); const count = target.advance(9); // assert assert.strictEqual(count, 0); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("set adds future entry, advance to due invokes", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.setInterval(spy.value, 10); + target.setInterval(spy.proxy, 10); const count = target.advance(10); // assert assert.strictEqual(count, 1); - spy.called(Times.once()); + spy.verify(_ => _(), Times.once()); }); it("set adds future entry, advance to due twice invokes twice", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.setInterval(spy.value, 10); + target.setInterval(spy.proxy, 10); const count = target.advance(20); // assert assert.strictEqual(count, 2); - spy.called(Times.exactly(2)); + spy.verify(_ => _(), Times.exactly(2)); }); it("set adds future entry, remove before second due time", () => { // arrange const target = new Timers(); - const spy = new Spy(() => { target.clearInterval(handle); }); + const spy = new Mock(() => { target.clearInterval(handle); }); // act - const handle = target.setInterval(spy.value, 10); + const handle = target.setInterval(spy.proxy, 10); const count = target.advance(20); // assert assert.strictEqual(count, 1); - spy.called(Times.exactly(1)); + spy.verify(_ => _(), Times.exactly(1)); }); }); describe("frame", () => { it("request adds entry, does not invoke", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - const handle = target.requestAnimationFrame(spy.value); + const handle = target.requestAnimationFrame(spy.proxy); const pending = target.getPending({ ms: 16 }); // assert assert.strictEqual(pending.length, 1); assert.strictEqual(pending[0].kind, "frame"); assert.isDefined(handle); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("request/cancel", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - const handle = target.requestAnimationFrame(spy.value); + const handle = target.requestAnimationFrame(spy.proxy); target.cancelAnimationFrame(handle); const pending = target.getPending(); // assert assert.strictEqual(pending.length, 0); - spy.called(Times.none()); + spy.verify(_ => _(), Times.none()); }); it("request and advance past one frame", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.requestAnimationFrame(spy.value); + target.requestAnimationFrame(spy.proxy); const count = target.advance(16); // assert assert.strictEqual(count, 1); - spy.called(Times.once()); + spy.verify(_ => _(Arg.number()), Times.once()); }); it("requests clamped to 16ms", () => { // arrange const target = new Timers(); - const spy = new Spy(); + const spy = Mock.function(); // act - target.requestAnimationFrame(spy.value); + target.requestAnimationFrame(spy.proxy); target.advance(10); - target.requestAnimationFrame(spy.value); + target.requestAnimationFrame(spy.proxy); const count = target.advance(16); // assert assert.strictEqual(count, 2); - spy.called(Times.exactly(2)); + spy.verify(_ => _(Arg.number()), Times.exactly(2)); }); }); }); \ No newline at end of file diff --git a/src/harness/mocks.ts b/src/harness/fakes.ts similarity index 90% rename from src/harness/mocks.ts rename to src/harness/fakes.ts index 97ea4b1e0ee07..6fae365810453 100644 --- a/src/harness/mocks.ts +++ b/src/harness/fakes.ts @@ -3,12 +3,12 @@ /// /// -// NOTE: The contents of this file are all exported from the namespace 'mocks'. This is to +// NOTE: The contents of this file are all exported from the namespace 'fakes'. This is to // support the eventual conversion of harness into a modular system. -// harness mocks -namespace mocks { - export interface MockServerHostOptions { +// harness fakes +namespace fakes { + export interface FakeServerHostOptions { /** * The `VirtualFleSystem` to use. If not specified, a new case-sensitive `VirtualFileSystem` * is created. @@ -32,7 +32,7 @@ namespace mocks { lib?: boolean; } - export class MockServerHost implements ts.server.ServerHost, ts.FormatDiagnosticsHost { + export class FakeServerHost implements ts.server.ServerHost, ts.FormatDiagnosticsHost { public static readonly defaultExecutingFilePath = "/.ts/tsc.js"; public static readonly defaultCurrentDirectory = "/"; public static readonly safeListPath = "/safelist.json"; @@ -67,16 +67,16 @@ namespace mocks { private readonly _executingFilePath: string; private readonly _getCanonicalFileName: (file: string) => string; - constructor(options: MockServerHostOptions = {}) { + constructor(options: FakeServerHostOptions = {}) { const { vfs: _vfs = {}, - executingFilePath = MockServerHost.defaultExecutingFilePath, + executingFilePath = FakeServerHost.defaultExecutingFilePath, newLine = "\n", safeList = false, lib = false } = options; - const { currentDirectory = MockServerHost.defaultCurrentDirectory, useCaseSensitiveFileNames = false } = _vfs; + const { currentDirectory = FakeServerHost.defaultCurrentDirectory, useCaseSensitiveFileNames = false } = _vfs; this.vfs = _vfs instanceof vfs.VirtualFileSystem ? _vfs : new vfs.VirtualFileSystem(currentDirectory, useCaseSensitiveFileNames); @@ -87,11 +87,11 @@ namespace mocks { this._getCanonicalFileName = ts.createGetCanonicalFileName(this.useCaseSensitiveFileNames); if (safeList) { - this.vfs.addFile(MockServerHost.safeListPath, MockServerHost.safeListContent); + this.vfs.addFile(FakeServerHost.safeListPath, FakeServerHost.safeListContent); } if (lib) { - this.vfs.addFile(MockServerHost.libPath, MockServerHost.libContent); + this.vfs.addFile(FakeServerHost.libPath, FakeServerHost.libContent); } } @@ -139,7 +139,7 @@ namespace mocks { public exit(exitCode?: number) { this.exitCode = exitCode; - throw MockServerHost.processExitSentinel; + throw FakeServerHost.processExitSentinel; } // #endregion DirectoryStructureHost members @@ -241,7 +241,7 @@ namespace mocks { this.timers.advanceToEnd(); } catch (e) { - if (e !== MockServerHost.processExitSentinel) { + if (e !== FakeServerHost.processExitSentinel) { throw e; } } diff --git a/src/harness/tsconfig.json b/src/harness/tsconfig.json index 06bc299d5981d..cf533cd03dc04 100644 --- a/src/harness/tsconfig.json +++ b/src/harness/tsconfig.json @@ -73,7 +73,7 @@ "../services/codefixes/disableJsDiagnostics.ts", "harness.ts", - + "core.ts", "utils.ts", "typemock.ts", @@ -82,7 +82,7 @@ "vpath.ts", "vfs.ts", "compiler.ts", - "mocks.ts", + "fakes.ts", "virtualFileSystemWithWatch.ts", "sourceMapRecorder.ts", diff --git a/src/harness/typemock.ts b/src/harness/typemock.ts index 32950dfac7412..f64af2bffb34c 100644 --- a/src/harness/typemock.ts +++ b/src/harness/typemock.ts @@ -7,92 +7,40 @@ // typemock library namespace typemock { - type Imported = T["prototype"]; - - function unwrap(module: any, _: () => PromiseLike): T { return module; } - - const module = unwrap(require("../../scripts/typemock"), () => import("../../scripts/typemock")); - - export const Arg = module.Arg; - - export interface Arg extends Imported { - } - - export interface Returns { - returns: U; - } - - export interface Throws { - throws: any; - } - - export const Mock = module.Mock; - - export interface Mock extends Imported { - readonly value: T; - setup(callback: (value: T) => U, result?: Returns | Throws): Mock; - setup(setups: Partial): Mock; - verify(callback: (value: T) => any, times: Times): Mock; - } - - export type Callable = ((...args: any[]) => any); - - export type Constructable = (new (...args: any[]) => any); - - export const Spy = module.Spy; - - export interface Spy extends Imported { - readonly value: T; - verify(callback: (value: T) => any, times: Times): this; - } - - export const Times = module.Times; - - export interface Times extends Imported { - } - - export interface Immediate { - readonly kind: "immediate"; - readonly handle: number; - readonly callback: (...args: any[]) => void; - readonly args: ReadonlyArray; - } - - export interface Timeout { - readonly kind: "timeout"; - readonly handle: number; - readonly callback: (...args: any[]) => void; - readonly args: ReadonlyArray; - } - - export interface Interval { - readonly kind: "interval"; - readonly handle: number; - readonly callback: (...args: any[]) => void; - readonly args: ReadonlyArray; - readonly interval: number; - } - - export interface AnimationFrame { - readonly kind: "frame"; - readonly handle: number; - readonly callback: (time: number) => void; - } - - export declare type Timer = Immediate | Timeout | Interval | AnimationFrame; - - export const Timers = module.Timers; - - export interface Timers extends Imported { - } - - export const Stub = module.Stub; - - export interface Stub extends Imported { - readonly target: T; - readonly key: K; - stubValue: T[K]; - readonly originalValue: T[K]; - readonly currentValue: T[K]; + const module = require("typemock"); + typemock.Arg = module.Arg; + typemock.Times = module.Times; + typemock.Mock = module.Mock; + typemock.Spy = module.Spy; + typemock.Inject = module.Inject; + typemock.Timers = module.Timers; + typemock.spy = module.spy; +} + +declare module "typemock_" { + import * as typemock_ from "typemock"; + global { + namespace typemock { + export import Arg = typemock_.Arg; + export import Times = typemock_.Times; + export import Mock = typemock_.Mock; + export import Spy = typemock_.Spy; + export import Returns = typemock_.Returns; + export import Throws = typemock_.Throws; + export import ThisArg = typemock_.ThisArg; + export import Callback = typemock_.Callback; + export import Fallback = typemock_.Fallback; + export import Setup = typemock_.Setup; + export import Callable = typemock_.Callable; + export import Constructable = typemock_.Constructable; + export import Inject = typemock_.Inject; + export import Timers = typemock_.Timers; + export import Timer = typemock_.Timer; + export import Timeout = typemock_.Timeout; + export import Interval = typemock_.Interval; + export import Immediate = typemock_.Immediate; + export import AnimationFrame = typemock_.AnimationFrame; + export import spy = typemock_.spy; + } } } \ No newline at end of file diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index 12fc812773294..d462d55b4bede 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -2,7 +2,7 @@ /// /// /// -/// +/// namespace ts.projectSystem { const nullCancellationToken = server.nullCancellationToken; @@ -62,7 +62,7 @@ namespace ts.projectSystem { describe("for configured projects", () => { it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -109,7 +109,7 @@ namespace ts.projectSystem { }); it("should be up-to-date with the reference map changes", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -176,7 +176,7 @@ namespace ts.projectSystem { }); it("should be up-to-date with changes made in non-open files", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -211,7 +211,7 @@ namespace ts.projectSystem { }); it("should be up-to-date with deleted files", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -245,7 +245,7 @@ namespace ts.projectSystem { }); it("should be up-to-date with newly created files", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -279,7 +279,7 @@ namespace ts.projectSystem { }); it("should detect changes in non-root files", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; let y = Foo();`); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ "compileOnSave": true, "files": ["${file1Consumer1.path}"] }`); @@ -323,7 +323,7 @@ namespace ts.projectSystem { }); it("should return all files if a global file changed shape", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -352,7 +352,7 @@ namespace ts.projectSystem { }); it("should return empty array if CompileOnSave is not enabled", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{}`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -371,7 +371,7 @@ namespace ts.projectSystem { }); it("should save when compileOnSave is enabled in base tsconfig.json", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ "extends": "/a/tsconfig.json" }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -391,7 +391,7 @@ namespace ts.projectSystem { }); it("should always return the file itself if '--isolatedModules' is specified", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ "compileOnSave": true, "compilerOptions": { "isolatedModules": true } }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -416,7 +416,7 @@ namespace ts.projectSystem { }); it("should always return the file itself if '--out' or '--outFile' is specified", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ "compileOnSave": true, "compilerOptions": { "module": "system", "outFile": "/a/b/out.js" } }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -441,7 +441,7 @@ namespace ts.projectSystem { }); it("should return cascaded affected file list", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const file1Consumer1 = host.vfs.addFile("/a/b/file1Consumer1.ts", `import {Foo} from "./moduleFile1"; export var y = 10;`); @@ -481,7 +481,7 @@ namespace ts.projectSystem { }); it("should work fine for files with circular references", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const file1 = host.vfs.addFile("/a/b/file1.ts", `/// \nexport var t1 = 10;`); const file2 = host.vfs.addFile("/a/b/file2.ts", `/// \nexport var t2 = 10;`); @@ -496,7 +496,7 @@ namespace ts.projectSystem { }); it("should return results for all projects if not specifying projectFileName", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const file1 = host.vfs.addFile("/a/b/file1.ts", `export var t = 10;`); const file2 = host.vfs.addFile("/a/b/file2.ts", `import {t} from "./file1"; var t2 = 11;`); const file3 = host.vfs.addFile("/a/c/file2.ts", `import {t} from "../b/file1"; var t3 = 11;`); @@ -516,7 +516,7 @@ namespace ts.projectSystem { }); it("should detect removed code file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const moduleFile1 = host.vfs.addFile("/a/b/moduleFile1.ts", `export function Foo() { };`); const referenceFile1 = host.vfs.addFile("/a/b/referenceFile1.ts", `/// \nexport var x = Foo();`); @@ -537,7 +537,7 @@ namespace ts.projectSystem { }); it("should detect non-existing code file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{ compileOnSave": true }`); const referenceFile1 = host.vfs.addFile("/a/b/referenceFile1.ts", `/// \nexport var x = Foo();`); @@ -558,7 +558,7 @@ namespace ts.projectSystem { test("\r\n"); function test(newLine: "\r\n" | "\n") { - const host = new mocks.MockServerHost({ newLine }); + const host = new fakes.FakeServerHost({ newLine }); const f = host.vfs.addFile("/a/app.ts", `var x = 1;${newLine}var y = 2;`); const session = createSession(host); @@ -572,7 +572,7 @@ namespace ts.projectSystem { }); it("should emit specified file", () => { - const host = new mocks.MockServerHost({ newLine: "\r\n" }); + const host = new fakes.FakeServerHost({ newLine: "\r\n" }); const file1 = host.vfs.addFile("/a/b/f1.ts", `export function Foo() { return 10; }`); const file2 = host.vfs.addFile("/a/b/f2.ts", `import {Foo} from "./f1"; let y = Foo();`); const configFile = host.vfs.addFile("/a/b/tsconfig.json", `{}`); @@ -593,7 +593,7 @@ namespace ts.projectSystem { it("shoud not emit js files in external projects", () => { const externalProjectName = "/a/b/externalproject"; - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const file1 = host.vfs.addFile("/a/b/file1.ts", `consonle.log('file1');`); // file2 has errors. The emit should not be blocked. const file2 = host.vfs.addFile("/a/b/file2.js", `console.log'file2');`); @@ -626,7 +626,7 @@ namespace ts.projectSystem { it("should use project root as current directory so that compile on save results in correct file mapping", () => { const externalProjectName = "/root/TypeScriptProject3/TypeScriptProject3/TypeScriptProject3.csproj"; - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const file1 = host.vfs.addFile("/root/TypeScriptProject3/TypeScriptProject3/Foo.ts", `consonle.log('file1');`); host.vfs.addFile(libFile.path, libFile.content); diff --git a/src/harness/unittests/projectErrors.ts b/src/harness/unittests/projectErrors.ts index 7ea2af973d083..92cb5e1c9d965 100644 --- a/src/harness/unittests/projectErrors.ts +++ b/src/harness/unittests/projectErrors.ts @@ -1,7 +1,7 @@ /// /// /// -/// +/// namespace ts.projectSystem { describe("Project errors", () => { @@ -31,7 +31,7 @@ namespace ts.projectSystem { } it("external project - diagnostics for missing files", () => { - const host = new mocks.MockServerHost({ safeList: true, lib: true }); + const host = new fakes.FakeServerHost({ safeList: true, lib: true }); host.vfs.addFile("/a/b/app.ts", ``); const projectFileName = "/a/b/test.csproj"; @@ -66,7 +66,7 @@ namespace ts.projectSystem { }); it("configured projects - diagnostics for missing files", () => { - const host = new mocks.MockServerHost({ safeList: true, lib: true }); + const host = new fakes.FakeServerHost({ safeList: true, lib: true }); host.vfs.addFile("/a/b/app.ts", ``); host.vfs.addFile("/a/b/tsconfig.json", `{ "files": ["app.ts", "applib.ts"] }`); @@ -88,7 +88,7 @@ namespace ts.projectSystem { }); it("configured projects - diagnostics for corrupted config 1", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); host.vfs.addFile("/a/b/app.ts", ``); host.vfs.addFile("/a/b/lib.ts", ``); host.vfs.addFile("/a/b/tsconfig.json", ` "files": ["app.ts", "lib.ts"] }`); @@ -122,7 +122,7 @@ namespace ts.projectSystem { }); it("configured projects - diagnostics for corrupted config 2", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); host.vfs.addFile("/a/b/app.ts", ``); host.vfs.addFile("/a/b/lib.ts", ``); host.vfs.addFile("/a/b/tsconfig.json", `{ "files": ["app.ts", "lib.ts"] }`); diff --git a/src/harness/unittests/reuseProgramStructure.ts b/src/harness/unittests/reuseProgramStructure.ts index 83bf2217db58e..7219c58937b67 100644 --- a/src/harness/unittests/reuseProgramStructure.ts +++ b/src/harness/unittests/reuseProgramStructure.ts @@ -1,5 +1,6 @@ /// /// +/// namespace ts { @@ -915,7 +916,7 @@ namespace ts { } function verifyProgram(vfs: vfs.VirtualFileSystem, rootFiles: string[], options: CompilerOptions, configFile: string) { - const watchingSystemHost = createWatchingSystemHost(new mocks.MockServerHost({ vfs })); + const watchingSystemHost = createWatchingSystemHost(new fakes.FakeServerHost({ vfs })); verifyProgramWithoutConfigFile(watchingSystemHost, rootFiles, options); verifyProgramWithConfigFile(watchingSystemHost, configFile); } @@ -997,7 +998,7 @@ namespace ts { `export default classD;`); const configFile = fs.addFile("/src/tsconfig.json", JSON.stringify({ compilerOptions, include: ["packages/**/ *.ts"] })); - const watchingSystemHost = createWatchingSystemHost(new mocks.MockServerHost({ vfs: fs })); + const watchingSystemHost = createWatchingSystemHost(new fakes.FakeServerHost({ vfs: fs })); verifyProgramWithConfigFile(watchingSystemHost, configFile.path); }); }); diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 22ec81d583e50..7719b2c9937c7 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -1,12 +1,12 @@ /// /// /// -/// +/// /// namespace ts.tscWatch { import theory = utils.theory; - import Spy = typemock.Spy; + import spy = typemock.spy; import Arg = typemock.Arg; import Times = typemock.Times; @@ -63,7 +63,7 @@ namespace ts.tscWatch { return result; } - function checkOutputErrors(host: mocks.MockServerHost, errors: ReadonlyArray, isInitial?: true, skipWaiting?: true) { + function checkOutputErrors(host: fakes.FakeServerHost, errors: ReadonlyArray, isInitial?: true, skipWaiting?: true) { const outputs = host.getOutput(); const expectedOutputCount = (isInitial ? 0 : 1) + errors.length + (skipWaiting ? 0 : 1); assert.equal(outputs.length, expectedOutputCount, "Outputs = " + outputs.toString()); @@ -82,17 +82,17 @@ namespace ts.tscWatch { host.clearOutput(); } - function assertDiagnosticAt(host: mocks.MockServerHost, outputAt: number, diagnostic: Diagnostic) { + function assertDiagnosticAt(host: fakes.FakeServerHost, outputAt: number, diagnostic: Diagnostic) { const output = host.getOutput()[outputAt]; assert.equal(output, formatDiagnostic(diagnostic, host), "outputs[" + outputAt + "] is " + output); } - function assertWatchDiagnosticAt(host: mocks.MockServerHost, outputAt: number, diagnosticMessage: DiagnosticMessage) { + function assertWatchDiagnosticAt(host: fakes.FakeServerHost, outputAt: number, diagnosticMessage: DiagnosticMessage) { const output = host.getOutput()[outputAt]; assert.isTrue(endsWith(output, getWatchDiagnosticWithoutDate(host, diagnosticMessage)), "outputs[" + outputAt + "] is " + output); } - function getWatchDiagnosticWithoutDate(host: mocks.MockServerHost, diagnosticMessage: DiagnosticMessage) { + function getWatchDiagnosticWithoutDate(host: fakes.FakeServerHost, diagnosticMessage: DiagnosticMessage) { return ` - ${flattenDiagnosticMessageText(getLocaleSpecificMessage(diagnosticMessage), host.newLine)}${host.newLine + host.newLine + host.newLine}`; } @@ -159,12 +159,12 @@ namespace ts.tscWatch { describe("program updates", () => { it("create watch without config file", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/c/app.ts", `import {f} from "./module"\nconsole.log(f)`); host.vfs.addFile("/a/b/c/module.d.ts", `export let x: number`); const watch = createWatchModeWithoutConfigFile(["/a/b/c/app.ts"], host); - checkProgramActualFiles(watch(), ["/a/b/c/app.ts", mocks.MockServerHost.libPath, "/a/b/c/module.d.ts"]); + checkProgramActualFiles(watch(), ["/a/b/c/app.ts", fakes.FakeServerHost.libPath, "/a/b/c/module.d.ts"]); // TODO: Should we watch creation of config files in the root file's file hierarchy? @@ -174,7 +174,7 @@ namespace ts.tscWatch { }); it("can handle tsconfig file name with difference casing", () => { - const host = new mocks.MockServerHost({ vfs: { useCaseSensitiveFileNames: false } }); + const host = new fakes.FakeServerHost({ vfs: { useCaseSensitiveFileNames: false } }); host.vfs.addFile("/a/b/app.ts", `let x = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{ "include": ["app.ts"] }`); @@ -183,7 +183,7 @@ namespace ts.tscWatch { }); it("create configured project without file list", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "exclude": ["e"] }`); host.vfs.addFile("/a/b/c/f1.ts", `let x = 1`); host.vfs.addFile("/a/b/d/f2.ts", `let y = 1`); @@ -195,9 +195,9 @@ namespace ts.tscWatch { const watch = ts.createWatchModeWithConfigFile(configFileResult, {}, watchingSystemHost); - checkProgramActualFiles(watch(), ["/a/b/c/f1.ts", mocks.MockServerHost.libPath, "/a/b/d/f2.ts"]); + checkProgramActualFiles(watch(), ["/a/b/c/f1.ts", fakes.FakeServerHost.libPath, "/a/b/d/f2.ts"]); checkProgramRootFiles(watch(), ["/a/b/c/f1.ts", "/a/b/d/f2.ts"]); - checkWatchedFiles(host, ["/a/b/tsconfig.json", "/a/b/c/f1.ts", "/a/b/d/f2.ts", mocks.MockServerHost.libPath]); + checkWatchedFiles(host, ["/a/b/tsconfig.json", "/a/b/c/f1.ts", "/a/b/d/f2.ts", fakes.FakeServerHost.libPath]); checkWatchedDirectories(host, ["/a/b", "/a/b/node_modules/@types"], /*recursive*/ true); }); @@ -206,7 +206,7 @@ namespace ts.tscWatch { // }); it("add new files to a configured program without file list", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{}`); @@ -222,7 +222,7 @@ namespace ts.tscWatch { }); it("should ignore non-existing files specified in the config file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["commonFile1.ts", "commonFile3.ts"] }`); @@ -233,7 +233,7 @@ namespace ts.tscWatch { }); it("handle recreated files correctly", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{}`); @@ -255,13 +255,13 @@ namespace ts.tscWatch { it("handles the missing files - that were added to program because they were added with /// { const file1Content = `/// \nlet x = y`; - const host = new mocks.MockServerHost({ lib: true, vfs: { useCaseSensitiveFileNames: false } }); + const host = new fakes.FakeServerHost({ lib: true, vfs: { useCaseSensitiveFileNames: false } }); host.vfs.addFile("/a/b/commonFile1.ts", file1Content); const watch = createWatchModeWithoutConfigFile(["/a/b/commonFile1.ts"], host); checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts"]); - checkProgramActualFiles(watch(), ["/a/b/commonFile1.ts", mocks.MockServerHost.libPath]); + checkProgramActualFiles(watch(), ["/a/b/commonFile1.ts", fakes.FakeServerHost.libPath]); checkOutputErrors(host, [ createFileNotFoundDiagnostic(watch(), "/a/b/commonFile1.ts", file1Content, "commonFile2.ts", "/a/b/commonFile2.ts"), createCannotFindNameDiagnostic(watch(), "/a/b/commonFile1.ts", file1Content, "y"), @@ -270,12 +270,12 @@ namespace ts.tscWatch { host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); host.checkTimeoutQueueLengthAndRun(1); checkProgramRootFiles(watch(), ["/a/b/commonFile1.ts"]); - checkProgramActualFiles(watch(), ["/a/b/commonFile1.ts", mocks.MockServerHost.libPath, "/a/b/commonFile2.ts"]); + checkProgramActualFiles(watch(), ["/a/b/commonFile1.ts", fakes.FakeServerHost.libPath, "/a/b/commonFile2.ts"]); checkOutputErrors(host, emptyArray); }); it("should reflect change in config file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["/a/b/commonFile1.ts", "/a/b/commonFile2.ts"] }`); @@ -289,7 +289,7 @@ namespace ts.tscWatch { }); it("files explicitly excluded in config file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); host.vfs.addFile("/a/c/excludedFile1.ts", `let t = 1;`); @@ -300,7 +300,7 @@ namespace ts.tscWatch { }); it("should properly handle module resolution changes in config file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/file1.ts", `import { T } from "module1";`); host.vfs.addFile("/a/b/node_modules/module1.ts", `export interface T {}`); host.vfs.addFile("/a/module1.ts", `export interface T {}`); @@ -317,7 +317,7 @@ namespace ts.tscWatch { }); it("should tolerate config file errors and still try to build a project", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/commonFile1.ts", `let x = 1`); host.vfs.addFile("/a/b/commonFile2.ts", `let y = 1`); host.vfs.addFile("/a/b/tsconfig.json", @@ -334,7 +334,7 @@ namespace ts.tscWatch { }); it("changes in files are reflected in project structure", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/f1.ts", `export * from "./f2"`); host.vfs.addFile("/a/b/f2.ts", `export let x = 1`); host.vfs.addFile("/a/c/f3.ts", `export let y = 1;`); @@ -350,7 +350,7 @@ namespace ts.tscWatch { }); it("deleted files affect project structure", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/f1.ts", `export * from "./f2"`); host.vfs.addFile("/a/b/f2.ts", `export * from "../c/f3"`); host.vfs.addFile("/a/c/f3.ts", `export let y = 1;`); @@ -364,7 +364,7 @@ namespace ts.tscWatch { }); it("deleted files affect project structure - 2", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/f1.ts", `export * from "./f2"`); host.vfs.addFile("/a/b/f2.ts", `export * from "../c/f3"`); host.vfs.addFile("/a/c/f3.ts", `export let y = 1;`); @@ -378,7 +378,7 @@ namespace ts.tscWatch { }); it("config file includes the file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/f1.ts", `export let x = 5`); host.vfs.addFile("/a/c/f2.ts", `import {x} from "../b/f1"`); host.vfs.addFile("/a/c/f3.ts", `export let y = 1`); @@ -390,7 +390,7 @@ namespace ts.tscWatch { }); it("correctly migrate files between projects", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/f1.ts", `export * from "../c/f2";\n` + `export * from "../d/f3";`); @@ -409,7 +409,7 @@ namespace ts.tscWatch { }); it("can correctly update configured project when set of root files has changed (new file on disk)", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/f1.ts", `let x = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); @@ -423,7 +423,7 @@ namespace ts.tscWatch { }); it("can correctly update configured project when set of root files has changed (new file in list of files)", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/f1.ts", `let x = 1`); host.vfs.addFile("/a/b/f2.ts", `let y = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["f1.ts"] }`); @@ -438,7 +438,7 @@ namespace ts.tscWatch { }); it("can update configured project when set of root files was not changed", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/f1.ts", `let x = 1`); host.vfs.addFile("/a/b/f2.ts", `let y = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "files": ["f1.ts", "f2.ts"] }`); @@ -453,14 +453,14 @@ namespace ts.tscWatch { }); it("config file is deleted", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/f1.ts", `let x = 1`); host.vfs.addFile("/a/b/f2.ts", `let y = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); - checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts", mocks.MockServerHost.libPath]); + checkProgramActualFiles(watch(), ["/a/b/f1.ts", "/a/b/f2.ts", fakes.FakeServerHost.libPath]); checkOutputErrors(host, emptyArray, /*isInitial*/ true); host.vfs.removeFile("/a/b/tsconfig.json"); @@ -473,7 +473,7 @@ namespace ts.tscWatch { }); it("Proper errors: document is not contained in project", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/app.ts", ``); host.vfs.addFile("/a/b/tsconfig.json", `{`); @@ -482,7 +482,7 @@ namespace ts.tscWatch { }); it("correctly handles changes in lib section of config file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/.ts/lib.es5.d.ts", `declare const eval: any`); host.vfs.addFile("/.ts/lib.es2015.promise.d.ts", `declare class Promise {}`); host.vfs.addFile("/src/app.ts", `var x: Promise;`); @@ -497,7 +497,7 @@ namespace ts.tscWatch { }); it("should handle non-existing directories in config file", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/src/app.ts", `let x = 1;`); host.vfs.addFile("/a/tsconfig.json", `{ "compilerOptions": {}, "include": ["src/**/*", "notexistingfolder/*"] }`); @@ -507,7 +507,7 @@ namespace ts.tscWatch { it("rename a module file and rename back should restore the states for inferred projects", () => { const file1Content = `import * as T from "./moduleFile"; T.bar();`; - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/file1.ts", file1Content); host.vfs.addFile("/a/b/moduleFile.ts", `export function bar() { };`); @@ -531,7 +531,7 @@ namespace ts.tscWatch { it("rename a module file and rename back should restore the states for configured projects", () => { const file1Content = `import * as T from "./moduleFile"; T.bar();`; - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/file1.ts", file1Content); host.vfs.addFile("/a/b/moduleFile.ts", `export function bar() { };`); host.vfs.addFile("/a/b/tsconfig.json", `{}`); @@ -555,7 +555,7 @@ namespace ts.tscWatch { }); it("types should load from config file path if config exists", () => { - const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/c" }}); + const host = new fakes.FakeServerHost({ vfs: { currentDirectory: "/a/c" } }); host.vfs.addDirectory("/a/c"); host.vfs.addFile("/a/b/app.ts", `let x = 1`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": { "types": ["node"], "typeRoots": [] } }`); @@ -567,7 +567,7 @@ namespace ts.tscWatch { it("add the missing module file for inferred project: should remove the `module not found` error", () => { const file1Content = `import * as T from "./moduleFile"; T.bar();`; - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/file1.ts", file1Content); const watch = createWatchModeWithoutConfigFile(["/a/b/file1.ts"], host); @@ -584,7 +584,7 @@ namespace ts.tscWatch { it("Configure file diagnostics events are generated when the config file has errors", () => { const configFileContent = `{ "compilerOptions": { "foo": "bar", "allowJS": true } }`; - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/app.ts", `let x = 10`); host.vfs.addFile("/a/b/tsconfig.json", configFileContent); @@ -596,7 +596,7 @@ namespace ts.tscWatch { }); it("If config file doesnt have errors, they are not reported", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/app.ts", `let x = 10`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); @@ -605,7 +605,7 @@ namespace ts.tscWatch { }); it("Reports errors when the config file changes", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/app.ts", `let x = 10`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {} }`); @@ -627,16 +627,16 @@ namespace ts.tscWatch { }); it("non-existing directories listed in config file input array should be tolerated without crashing the server", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/file1.ts", `let t = 10;`); host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": {}, "include": ["app/*", "test/**/*", "something"] }`); const watch = createWatchModeWithConfigFile("/a/b/tsconfig.json", host); - checkProgramActualFiles(watch(), [mocks.MockServerHost.libPath]); + checkProgramActualFiles(watch(), [fakes.FakeServerHost.libPath]); }); it("non-existing directories listed in config file input array should be able to handle @types if input file list is empty", () => { - const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/" } }); + const host = new fakes.FakeServerHost({ vfs: { currentDirectory: "/a/" } }); host.vfs.addFile("/a/app.ts", `let x = 1`); host.vfs.addFile("/a/tsconfig.json", `{ "compilerOptions": {}, "files": [] }`); host.vfs.addFile("/a/node_modules/@types/typings/index.d.ts", `export * from "./lib"`); @@ -648,11 +648,11 @@ namespace ts.tscWatch { }); it("should support files without extensions", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/compile", `let x = 1`); const watch = createWatchModeWithoutConfigFile(["/a/compile"], host, { allowNonTsExtensions: true }); - checkProgramActualFiles(watch(), ["/a/compile", mocks.MockServerHost.libPath]); + checkProgramActualFiles(watch(), ["/a/compile", fakes.FakeServerHost.libPath]); }); it("Options Diagnostic locations reported correctly with changes in configFile contents when options change", () => { @@ -675,7 +675,7 @@ namespace ts.tscWatch { ` }\n` + `}`; - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/b/app.ts", `let x = 10`); host.vfs.addFile("/a/b/tsconfig.json", configFileContentWithComment); @@ -713,13 +713,7 @@ namespace ts.tscWatch { ] }); - const filesWritten = new Map(); - const host = new class extends mocks.MockServerHost { - writeFile(path: string, data: string) { - filesWritten.set(path, (filesWritten.get(path) || 0) + 1); - super.writeFile(path, data); - } - }; + const host = new fakes.FakeServerHost(); host.vfs.addFile("/a/b/output/AnotherDependency/file1.d.ts", `declare namespace Common.SomeComponent.DynamicMenu { enum Z { Full = 0, Min = 1, Average = 2, } }`); host.vfs.addFile("/a/b/dependencies/file2.d.ts", `declare namespace Dependencies.SomeComponent { export class SomeClass { version: string; } }`); @@ -727,20 +721,23 @@ namespace ts.tscWatch { host.vfs.addFile("/a/b/project/src/main2.ts", `namespace main.file4 { import DynamicMenu = Common.SomeComponent.DynamicMenu; export function foo(a: DynamicMenu.z) { } }`); host.vfs.addFile("/a/b/project/tsconfig.json", configContent); + const writeFileSpy = spy(host, "writeFile"); + createWatchModeWithConfigFile("/a/b/project/tsconfig.json", host); if (useOutFile) { - // Only out file - assert.equal(filesWritten.size, 1); + writeFileSpy + .verify(_ => _("/a/b/output/common.js", Arg.string(), Arg.any()), Times.once()) + .verify(_ => _(Arg.string(), Arg.string(), Arg.any()), Times.once()) + .revoke(); } else { - // main.js and main2.js - assert.equal(filesWritten.size, 2); + writeFileSpy + .verify(_ => _("/a/b/output/main.js", Arg.string(), Arg.any()), Times.once()) + .verify(_ => _("/a/b/output/main2.js", Arg.string(), Arg.any()), Times.once()) + .verify(_ => _(Arg.string(), Arg.string(), Arg.any()), Times.exactly(2)) + .revoke(); } - - filesWritten.forEach((value, key) => { - assert.equal(value, 1, "Key: " + key); - }); } it("with --outFile and multiple declaration files in the program", () => { @@ -753,22 +750,22 @@ namespace ts.tscWatch { }); describe("emit", () => { - function writeFile(host: mocks.MockServerHost, path: string, content: string) { + function writeFile(host: fakes.FakeServerHost, path: string, content: string) { host.vfs.writeFile(path, content); } - function writeConfigFile(host: mocks.MockServerHost, path: string, config: any = {}) { + function writeConfigFile(host: fakes.FakeServerHost, path: string, config: any = {}) { const compilerOptions = (config.compilerOptions || (config.compilerOptions = {})); compilerOptions.listEmittedFiles = true; writeFile(host, path, JSON.stringify(config)); } - function waitAndCheckAffectedFiles(host: mocks.MockServerHost, affectedFiles: ReadonlyArray, unaffectedFiles?: ReadonlyArray) { + function waitAndCheckAffectedFiles(host: fakes.FakeServerHost, affectedFiles: ReadonlyArray, unaffectedFiles?: ReadonlyArray) { host.checkTimeoutQueueLengthAndRun(1); checkAffectedFiles(host, affectedFiles, unaffectedFiles); } - function checkAffectedFiles(host: mocks.MockServerHost, affectedFiles: ReadonlyArray, unaffectedFiles?: ReadonlyArray) { + function checkAffectedFiles(host: fakes.FakeServerHost, affectedFiles: ReadonlyArray, unaffectedFiles?: ReadonlyArray) { affectedFiles = getEmittedLines(affectedFiles, host, formatOutputFile); checkOutputContains(host, affectedFiles); if (unaffectedFiles) { @@ -788,13 +785,13 @@ namespace ts.tscWatch { const file2OutputPath = "/a/b.js"; const commonOutputPaths: ReadonlyArray = [file1OutputPath, file2OutputPath]; - function writeCommonFiles(host: mocks.MockServerHost) { + function writeCommonFiles(host: fakes.FakeServerHost) { writeFile(host, file1Path, `let x = 1`); writeFile(host, file2Path, `let y = 1`); } it("if neither is set", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath); @@ -806,7 +803,7 @@ namespace ts.tscWatch { }); it("if --out is set", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath, { compilerOptions: { out: "/a/out.js" } }); @@ -818,7 +815,7 @@ namespace ts.tscWatch { }); it("if --outFile is set", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath, { compilerOptions: { outFile: "/a/out.js" } }); @@ -851,7 +848,7 @@ namespace ts.tscWatch { globalFile3OutputPath ]; - function writeCommonFiles(host: mocks.MockServerHost, files?: string[]) { + function writeCommonFiles(host: fakes.FakeServerHost, files?: string[]) { if (!files || ts.contains(files, moduleFile1Path)) { writeFile(host, moduleFile1Path, `export function Foo() { };`); } @@ -870,7 +867,7 @@ namespace ts.tscWatch { } it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath); @@ -887,7 +884,7 @@ namespace ts.tscWatch { }); it("should be up-to-date with the reference map changes", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath); @@ -917,7 +914,7 @@ namespace ts.tscWatch { }); it("should be up-to-date with deleted files", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath); @@ -933,7 +930,7 @@ namespace ts.tscWatch { }); it("should be up-to-date with newly created files", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath); @@ -946,7 +943,7 @@ namespace ts.tscWatch { }); it("should detect changes in non-root files", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host, [file1Consumer1Path, moduleFile1Path]); writeConfigFile(host, configFilePath, { files: [file1Consumer1Path] }); @@ -963,7 +960,7 @@ namespace ts.tscWatch { }); it("should return all files if a global file changed shape", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath); @@ -976,7 +973,7 @@ namespace ts.tscWatch { }); it("should always return the file itself if '--isolatedModules' is specified", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath, { compilerOptions: { isolatedModules: true } }); @@ -989,7 +986,7 @@ namespace ts.tscWatch { }); it("should always return the file itself if '--out' or '--outFile' is specified", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath, { compilerOptions: { module: "system", outFile: "/a/b/out.js" } }); @@ -1001,7 +998,7 @@ namespace ts.tscWatch { }); it("should return cascaded affected file list", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeCommonFiles(host); writeConfigFile(host, configFilePath); @@ -1009,7 +1006,7 @@ namespace ts.tscWatch { checkAffectedFiles(host, commonOutputPaths); writeFile(host, "/a/b/file1Consumer1Consumer1.ts", `import {y} from "./file1Consumer1";`); - writeFile(host, file1Consumer1Path, `import {Foo} from "./moduleFile1"; export var y = 10; export var T: number;`) + writeFile(host, file1Consumer1Path, `import {Foo} from "./moduleFile1"; export var y = 10; export var T: number;`); waitAndCheckAffectedFiles(host, [file1Consumer1OutputPath, "/a/b/file1Consumer1Consumer1.js"], commonOutputPaths); // Doesn't change the shape of file1Consumer1 @@ -1017,14 +1014,14 @@ namespace ts.tscWatch { waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath, file1Consumer2OutputPath], commonOutputPaths); // Change both files before the timeout - writeFile(host, file1Consumer1Path, `import {Foo} from "./moduleFile1"; export var y = 10; export var T: number; export var T2: number;`) + writeFile(host, file1Consumer1Path, `import {Foo} from "./moduleFile1"; export var y = 10; export var T: number; export var T2: number;`); writeFile(host, moduleFile1Path, `export var T2: number;export function Foo() { };`); waitAndCheckAffectedFiles(host, [moduleFile1OutputPath, file1Consumer1OutputPath, file1Consumer2OutputPath, "/a/b/file1Consumer1Consumer1.js"], commonOutputPaths); }); it("should work fine for files with circular references", () => { // TODO: do not exit on such errors? Just continue to watch the files for update in watch mode - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeFile(host, "/a/b/file1.ts", `/// \nexport var t1 = 10;`); writeFile(host, "/a/b/file2.ts", `/// \nexport var t2 = 10;`); writeConfigFile(host, configFilePath); @@ -1037,7 +1034,7 @@ namespace ts.tscWatch { }); it("should detect removed code file", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeFile(host, "/a/b/referenceFile1.ts", `/// \nexport var x = Foo();`); writeCommonFiles(host, [moduleFile1Path]); writeConfigFile(host, configFilePath); @@ -1050,7 +1047,7 @@ namespace ts.tscWatch { }); it("should detect non-existing code file", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); writeFile(host, "/a/b/referenceFile1.ts", `/// \nexport var x = Foo();`); writeConfigFile(host, configFilePath); @@ -1071,7 +1068,7 @@ namespace ts.tscWatch { { title: "\\r\\n", args: ["\r\n"] }, { title: "\\n", args: ["\n"] } ], (newLine: "\r\n" | "\n") => { - const host = new mocks.MockServerHost({ newLine }); + const host = new fakes.FakeServerHost({ newLine }); writeFile(host, "/a/app.ts", `var x = 1;${newLine}var y = 2;`); createWatchModeWithoutConfigFile(["/a/app.ts"], host, { listEmittedFiles: true }); @@ -1088,80 +1085,64 @@ namespace ts.tscWatch { }); it("should emit specified file", () => { - const filesWritten = new Set(); - const host = new class extends mocks.MockServerHost { - writeFile(path: string, content: string) { - filesWritten.add(path); - super.writeFile(path, content); - } - }({ newLine: "\r\n" }); + const host = new fakes.FakeServerHost({ newLine: "\r\n" }); writeFile(host, "/a/b/f1.ts", `export function Foo() { return 10; }`); writeFile(host, "/a/b/f2.ts", `import {Foo} from "./f1"; export let y = Foo();`); writeFile(host, "/a/b/f3.ts", `import {y} from "./f2"; let x = y;`); writeConfigFile(host, "/a/b/tsconfig.json"); + const writeFileSpy1 = spy(host, "writeFile"); + createWatchModeWithConfigFile("/a/b/tsconfig.json", host); checkAffectedFiles(host, ["/a/b/f1.js", "/a/b/f2.js", "/a/b/f3.js"]); - assert.isTrue(filesWritten.has("/a/b/f1.js")); - assert.strictEqual(host.readFile("/a/b/f1.js"), `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`); + writeFileSpy1 + .verify(_ => _("/a/b/f1.js", `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\n`, Arg.any()), Times.once()) + .verify(_ => _("/a/b/f2.js", `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`, Arg.any()), Times.once()) + .verify(_ => _("/a/b/f3.js", `"use strict";\r\nexports.__esModule = true;\r\nvar f2_1 = require("./f2");\r\nvar x = f2_1.y;\r\n`, Arg.any()), Times.once()) + .revoke(); - assert.isTrue(filesWritten.has("/a/b/f2.js")); - assert.strictEqual(host.readFile("/a/b/f2.js"), `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`); - - assert.isTrue(filesWritten.has("/a/b/f3.js")); - assert.strictEqual(host.readFile("/a/b/f3.js"), `"use strict";\r\nexports.__esModule = true;\r\nvar f2_1 = require("./f2");\r\nvar x = f2_1.y;\r\n`); - - filesWritten.clear(); + const writeFileSpy2 = spy(host, "writeFile"); writeFile(host, "/a/b/f1.ts", `export function Foo() { return 10; }export function foo2() { return 2; }`); waitAndCheckAffectedFiles(host, ["/a/b/f1.js", "/a/b/f2.js"], ["/a/b/f3.js"]); - assert.isTrue(filesWritten.has("/a/b/f1.js")); - assert.strictEqual(host.readFile("/a/b/f1.js"), `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\nfunction foo2() { return 2; }\r\nexports.foo2 = foo2;\r\n`); - - assert.isTrue(filesWritten.has("/a/b/f2.js")); - assert.strictEqual(host.readFile("/a/b/f2.js"), `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`); - - assert.isFalse(filesWritten.has("/a/b/f3.js")); + writeFileSpy2 + .verify(_ => _("/a/b/f1.js", `"use strict";\r\nexports.__esModule = true;\r\nfunction Foo() { return 10; }\r\nexports.Foo = Foo;\r\nfunction foo2() { return 2; }\r\nexports.foo2 = foo2;\r\n`, Arg.any()), Times.once()) + .verify(_ => _("/a/b/f2.js", `"use strict";\r\nexports.__esModule = true;\r\nvar f1_1 = require("./f1");\r\nexports.y = f1_1.Foo();\r\n`, Arg.any()), Times.once()) + .verify(_ => _("/a/b/f3.js", Arg.string(), Arg.any()), Times.none()) + .revoke(); }); it("Elides const enums correctly in incremental compilation", () => { - const filesWritten = new Set(); - const host = new class extends mocks.MockServerHost { - writeFile(path: string, content: string) { - filesWritten.add(path); - super.writeFile(path, content); - } - }({ lib: true, newLine: "\n" }); + const host = new fakes.FakeServerHost({ lib: true, newLine: "\n" }); writeFile(host, "/user/someone/projects/myproject/file1.ts", `export const enum E1 { V = 1 }`); writeFile(host, "/user/someone/projects/myproject/file2.ts", `import { E1 } from "./file1"; export const enum E2 { V = E1.V }`); writeFile(host, "/user/someone/projects/myproject/file3.ts", `import { E2 } from "./file2"; const v: E2 = E2.V;`); + const writeFileSpy1 = spy(host, "writeFile"); + createWatchModeWithoutConfigFile(["/user/someone/projects/myproject/file1.ts", "/user/someone/projects/myproject/file2.ts", "/user/someone/projects/myproject/file3.ts"], host, { listEmittedFiles: true }); checkAffectedFiles(host, ["/user/someone/projects/myproject/file1.js", "/user/someone/projects/myproject/file2.js", "/user/someone/projects/myproject/file3.js"]); - assert.isTrue(filesWritten.has("/user/someone/projects/myproject/file1.js")); - assert.strictEqual(host.readFile("/user/someone/projects/myproject/file1.js"), `"use strict";\nexports.__esModule = true;\n`); - - assert.isTrue(filesWritten.has("/user/someone/projects/myproject/file2.js")); - assert.strictEqual(host.readFile("/user/someone/projects/myproject/file2.js"), `"use strict";\nexports.__esModule = true;\n`); - - assert.isTrue(filesWritten.has("/user/someone/projects/myproject/file3.js")); - assert.strictEqual(host.readFile("/user/someone/projects/myproject/file3.js"), `"use strict";\nexports.__esModule = true;\nvar v = 1 /* V */;\n`); + writeFileSpy1 + .verify(_ => _("/user/someone/projects/myproject/file1.js", `"use strict";\nexports.__esModule = true;\n`, Arg.any()), Times.once()) + .verify(_ => _("/user/someone/projects/myproject/file2.js", `"use strict";\nexports.__esModule = true;\n`, Arg.any()), Times.once()) + .verify(_ => _("/user/someone/projects/myproject/file3.js", `"use strict";\nexports.__esModule = true;\nvar v = 1 /* V */;\n`, Arg.any()), Times.once()) + .revoke(); - filesWritten.clear(); + const writeFileSpy2 = spy(host, "writeFile"); writeFile(host, "/user/someone/projects/myproject/file1.ts", `export const enum E1 { V = 1 }function foo2() { return 2; }`); waitAndCheckAffectedFiles(host, ["/user/someone/projects/myproject/file1.js"], ["/user/someone/projects/myproject/file2.js", "/user/someone/projects/myproject/file3.js"]); - assert.isTrue(filesWritten.has("/user/someone/projects/myproject/file1.js")); - assert.strictEqual(host.readFile("/user/someone/projects/myproject/file1.js"), `"use strict";\nexports.__esModule = true;\nfunction foo2() { return 2; }\n`); - - assert.isFalse(filesWritten.has("/user/someone/projects/myproject/file2.js")); - assert.isFalse(filesWritten.has("/user/someone/projects/myproject/file3.js")); + writeFileSpy2 + .verify(_ => _("/user/someone/projects/myproject/file1.js", `"use strict";\nexports.__esModule = true;\nfunction foo2() { return 2; }\n`, Arg.any()), Times.once()) + .verify(_ => _("/user/someone/projects/myproject/file2.js", Arg.string(), Arg.any()), Times.none()) + .verify(_ => _("/user/someone/projects/myproject/file3.js", Arg.string(), Arg.any()), Times.none()) + .revoke(); }); }); }); @@ -1171,11 +1152,10 @@ namespace ts.tscWatch { const rootContent1 = `import {x} from "f1"`; const importedContent = `foo()`; - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/d/f0.ts", rootContent1); host.vfs.addFile("/a/f1.ts", importedContent); - const fileExists = host.fileExists; const watch = createWatchModeWithoutConfigFile(["/a/d/f0.ts"], host, { module: ModuleKind.AMD }); // ensure that imported file was found @@ -1185,8 +1165,7 @@ namespace ts.tscWatch { ], /*isInitial*/ true); // spy on calls to fileExists to make sure that disk is not touched - const fileExistsSpy1 = new Spy(fileExists); - host.fileExists = fileExistsSpy1.value; + const fileExistsSpy1 = spy(host, "fileExists"); // write file and trigger synchronization const rootContent2 = `import {x} from "f1"\nvar x: string = 1;`; @@ -1194,7 +1173,9 @@ namespace ts.tscWatch { host.runQueuedTimeoutCallbacks(); // verify fileExists was not called. - fileExistsSpy1.verify(_ => _(Arg.any()), Times.none()); + fileExistsSpy1 + .verify(_ => _(Arg.any()), Times.none()) + .revoke(); // ensure file has correct number of errors after edit checkOutputErrors(host, [ @@ -1204,8 +1185,7 @@ namespace ts.tscWatch { ]); // spy on calls to fileExists to make sure LSHost only searches for 'f2' - const fileExistsSpy2 = new Spy(fileExists); - host.fileExists = fileExistsSpy2.value; + const fileExistsSpy2 = spy(host, "fileExists"); // write file and trigger synchronization const rootContent3 = `import {x} from "f2"`; @@ -1215,7 +1195,8 @@ namespace ts.tscWatch { // verify fileExists was called correctly fileExistsSpy2 .verify(_ => _(Arg.includes("/f2.")), Times.atLeastOnce()) - .verify(_ => _(Arg.not(Arg.includes("/f2."))), Times.none()); + .verify(_ => _(Arg.not(Arg.includes("/f2."))), Times.none()) + .revoke(); // ensure file has correct number of errors after edit checkOutputErrors(host, [ @@ -1223,8 +1204,7 @@ namespace ts.tscWatch { ]); // spy on calls to fileExists to make sure LSHost only searches for 'f1' - const fileExistsSpy3 = new Spy(fileExists); - host.fileExists = fileExistsSpy3.value; + const fileExistsSpy3 = spy(host, "fileExists"); // write file and trigger synchronization const rootContent4 = `import {x} from "f1"`; @@ -1234,7 +1214,8 @@ namespace ts.tscWatch { // verify fileExists was called correctly fileExistsSpy3 .verify(_ => _(Arg.includes("/f1.")), Times.atLeastOnce()) - .verify(_ => _(Arg.not(Arg.includes("/f1."))), Times.none()); + .verify(_ => _(Arg.not(Arg.includes("/f1."))), Times.none()) + .revoke(); checkOutputErrors(host, [ createFileIsNotAModuleDiagnostic(watch(), "/a/d/f0.ts", rootContent1, "f1", "/a/f1.ts"), @@ -1245,34 +1226,34 @@ namespace ts.tscWatch { it("loads missing files from disk", () => { const rootContent1 = `import {x} from "bar"`; - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/foo.ts", rootContent1); - const fileExists = host.fileExists; - // spy on calls to fileExists when starting watch mode - const fileExistsSpy1 = new Spy(fileExists); - host.fileExists = fileExistsSpy1.value; + const fileExistsSpy1 = spy(host, "fileExists"); const watch = createWatchModeWithoutConfigFile(["/a/foo.ts"], host, { module: ModuleKind.AMD }); // verify fileExists was called correctly - fileExistsSpy1.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); + fileExistsSpy1 + .verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()) + .revoke(); checkOutputErrors(host, [ createCannotFindModuleDiagnostic(watch(), "/a/foo.ts", rootContent1, "bar") ], /*isInitial*/ true); // spy on calls to fileExists after synchronization is triggered - const fileExistsSpy2 = new Spy(fileExists); - host.fileExists = fileExistsSpy2.value; + const fileExistsSpy2 = spy(host, "fileExists"); host.vfs.writeFile("/a/foo.ts", `import {y} from "bar"`); host.vfs.writeFile("/a/bar.d.ts", `export const y = 1;`); host.runQueuedTimeoutCallbacks(); // verify fileExists was called correctly - fileExistsSpy2.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); + fileExistsSpy2 + .verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()) + .revoke(); checkOutputErrors(host, emptyArray); }); @@ -1281,53 +1262,54 @@ namespace ts.tscWatch { const rootContent = `import {x} from "bar"`; const importedContent = `export const y = 1;export const x = 10;`; - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/foo.ts", rootContent); host.vfs.addFile("/a/bar.d.ts", importedContent); - const fileExists = host.fileExists; - // spy on fileExists when starting watch mode - const fileExistsSpy1 = new Spy(fileExists); - host.fileExists = fileExistsSpy1.value; + const fileExistsSpy1 = spy(host, "fileExists"); const watch = createWatchModeWithoutConfigFile(["/a/foo.ts"], host, { module: ModuleKind.AMD }); // verify fileExists was called correctly - fileExistsSpy1.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); + fileExistsSpy1 + .verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()) + .revoke(); checkOutputErrors(host, emptyArray, /*isInitial*/ true); // spy on fileExists when triggering synchronization - const fileExistsSpy2 = new Spy(fileExists); - host.fileExists = fileExistsSpy2.value; + const fileExistsSpy2 = spy(host, "fileExists"); host.vfs.removeFile("/a/bar.d.ts"); host.runQueuedTimeoutCallbacks(); // verify fileExists was called correctly - fileExistsSpy2.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); + fileExistsSpy2 + .verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()) + .revoke(); checkOutputErrors(host, [ createCannotFindModuleDiagnostic(watch(), "/a/foo.ts", rootContent, "bar") ]); // spy on fileExists when triggering synchronization - const fileExistsSpy3 = new Spy(fileExists); - host.fileExists = fileExistsSpy3.value; + const fileExistsSpy3 = spy(host, "fileExists"); - host.vfs.writeFile("/a/bar.d.ts", importedContent);; + host.vfs.writeFile("/a/bar.d.ts", importedContent); host.checkTimeoutQueueLengthAndRun(1); // verify fileExists was called correctly. - fileExistsSpy3.verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()); + fileExistsSpy3 + .verify(_ => _(Arg.includes("/bar.")), Times.atLeastOnce()) + .revoke(); checkOutputErrors(host, emptyArray); }); it("works when module resolution changes to ambient module", () => { const rootContent = `import * as fs from "fs";`; - const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/b" }, lib: true }); + const host = new fakes.FakeServerHost({ vfs: { currentDirectory: "/a/b" }, lib: true }); host.vfs.addFile("/a/b/foo.ts", rootContent); const watch = createWatchModeWithoutConfigFile(["/a/b/foo.ts"], host, { }); @@ -1346,7 +1328,7 @@ namespace ts.tscWatch { const rootContent = `import * as fs from "fs";\nimport * as u from "url";`; const fileContent1 = `declare module "url" {\n export interface Url {\n href?: string;\n }\n}`; - const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/b" }, lib: true }); + const host = new fakes.FakeServerHost({ vfs: { currentDirectory: "/a/b" }, lib: true }); host.vfs.addFile("/a/b/foo.ts", rootContent); host.vfs.addFile("/a/b/bar.d.ts", fileContent1); @@ -1368,7 +1350,7 @@ namespace ts.tscWatch { const file2Content = `import module11 = require("module1");\nmodule11("hello");`; const file2Output = `"use strict";\nexports.__esModule = true;\nvar module11 = require("module1");\nmodule11("hello");\n`; - const host = new mocks.MockServerHost({ vfs: { currentDirectory: "/a/b/projects/myProject/" }, lib: true }); + const host = new fakes.FakeServerHost({ vfs: { currentDirectory: "/a/b/projects/myProject/" }, lib: true }); host.vfs.addFile("/a/b/projects/myProject/src/file1.ts", file1Content); host.vfs.addFile("/a/b/projects/myProject/src/file2.ts", file2Content); host.vfs.addFile("/a/b/projects/myProject/node_modules/module1/index.js", `module.exports = options => { return options.toString(); }`); @@ -1382,18 +1364,15 @@ namespace ts.tscWatch { } })); - const writeFile = host.writeFile; - // spy on calls to writeFile when starting watch mode - const writeFileSpy1 = new Spy(writeFile); - host.writeFile = writeFileSpy1.value; + const writeFileSpy1 = spy(host, "writeFile"); const watch = createWatchModeWithConfigFile("/a/b/projects/myProject/src/tsconfig.json", host); checkProgramActualFiles(watch(), [ "/a/b/projects/myProject/src/file1.ts", "/a/b/projects/myProject/src/file2.ts", "/a/b/projects/myProject/node_modules/module1/index.js", - mocks.MockServerHost.libPath + fakes.FakeServerHost.libPath ]); checkOutputErrors(host, emptyArray, /*isInitial*/ true); @@ -1401,16 +1380,11 @@ namespace ts.tscWatch { writeFileSpy1 .verify(_ => _("/a/b/projects/myProject/dist/file1.js", file1Output, Arg.any()), Times.once()) .verify(_ => _("/a/b/projects/myProject/dist/file2.js", file2Output, Arg.any()), Times.once()) - .verify(_ => _("/a/b/projects/myProject/dist/index.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/src/index.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/src/file1.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/src/file2.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/lib.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/lib.d.ts", Arg.string(), Arg.any()), Times.none()); + .verify(_ => _(Arg.nor("/a/b/projects/myProject/dist/file1.js", "/a/b/projects/myProject/dist/file2.js"), Arg.string(), Arg.any()), Times.none()) + .revoke(); // spy on calls to writeFile when triggering synchronization - const writeFileSpy2 = new Spy(writeFile); - host.writeFile = writeFileSpy2.value; + const writeFileSpy2 = spy(host, "writeFile"); host.vfs.writeFile("/a/b/projects/myProject/src/file1.ts", file1Content + "\n;"); host.runQueuedTimeoutCallbacks(); @@ -1418,26 +1392,21 @@ namespace ts.tscWatch { "/a/b/projects/myProject/src/file1.ts", "/a/b/projects/myProject/src/file2.ts", "/a/b/projects/myProject/node_modules/module1/index.js", - mocks.MockServerHost.libPath + fakes.FakeServerHost.libPath ]); checkOutputErrors(host, emptyArray); // verify writeFile was called correctly writeFileSpy2 .verify(_ => _("/a/b/projects/myProject/dist/file1.js", file1Output + ";\n", Arg.any()), Times.once()) - .verify(_ => _("/a/b/projects/myProject/dist/file2.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/index.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/src/index.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/src/file1.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/src/file2.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/lib.js", Arg.string(), Arg.any()), Times.none()) - .verify(_ => _("/a/b/projects/myProject/dist/lib.d.ts", Arg.string(), Arg.any()), Times.none()); + .verify(_ => _(Arg.not("/a/b/projects/myProject/dist/file1.js"), Arg.string(), Arg.any()), Times.none()) + .revoke(); }); }); describe("with when module emit is specified as node", () => { it("when instead of filechanged recursive directory watcher is invoked", () => { - const host = new mocks.MockServerHost({ lib: true }); + const host = new fakes.FakeServerHost({ lib: true }); host.vfs.addFile("/a/rootFolder/project/Scripts/TypeScript.ts", `var z = 10;`); host.vfs.addFile("/a/rootFolder/project/Scripts/Javascript.js", `var zz = 10;`); host.vfs.addFile("/a/rootFolder/project/tsconfig.json", JSON.stringify({ @@ -1451,13 +1420,12 @@ namespace ts.tscWatch { ], })); - const writeFile = host.writeFile; const watch = createWatchModeWithConfigFile("/a/rootFolder/project/tsconfig.json", host); checkProgramActualFiles(watch(), [ "/a/rootFolder/project/Scripts/TypeScript.ts", "/a/rootFolder/project/Scripts/Javascript.js", - mocks.MockServerHost.libPath + fakes.FakeServerHost.libPath ]); @@ -1465,8 +1433,7 @@ namespace ts.tscWatch { host.vfs.removeFile("/a/rootFolder/project/Scripts/TypeScript.ts"); host.runQueuedTimeoutCallbacks(); - const writeFileSpy1 = new Spy(writeFile); - host.writeFile = writeFileSpy1.value; + const writeFileSpy1 = spy(host, "writeFile"); host.vfs.writeFile("/a/rootFolder/project/Scripts/TypeScript.ts", `var zz30 = 100;`); host.runQueuedTimeoutCallbacks(); @@ -1474,10 +1441,12 @@ namespace ts.tscWatch { checkProgramActualFiles(watch(), [ "/a/rootFolder/project/Scripts/TypeScript.ts", "/a/rootFolder/project/Scripts/Javascript.js", - mocks.MockServerHost.libPath + fakes.FakeServerHost.libPath ]); - writeFileSpy1.verify(_ => _("/a/rootFolder/project/Static/scripts/TypeScript.js", `var zz30 = 100;\n`, Arg.any()), Times.once()); + writeFileSpy1 + .verify(_ => _("/a/rootFolder/project/Static/scripts/TypeScript.js", `var zz30 = 100;\n`, Arg.any()), Times.once()) + .revoke(); }); }); }); diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 0ef61c1317d24..35358e14ad4f3 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -99,7 +99,7 @@ namespace ts.projectSystem { this.addPostExecAction("success", cb); } - sendResponse(response: server.SetTypings | server.InvalidateCachedTypings) { + sendResponse(response: server.SetTypings | server.InvalidateCachedTypings | server.BeginInstallTypes | server.EndInstallTypes) { this.projectService.updateTypingsForProject(response); } @@ -5583,7 +5583,7 @@ namespace ts.projectSystem { content: "export class Cookie { }" }; const es2016LibFile: FileOrFolder = { - path: "/a/lib/lib.es2016.full.d.ts", + path: "/.ts/lib.es2016.full.d.ts", content: libFile.content }; const typeRoots = ["types", "node_modules/@types"]; diff --git a/src/harness/unittests/typingsInstaller.ts b/src/harness/unittests/typingsInstaller.ts index 2d9a86607fad5..82e22e01ce4f0 100644 --- a/src/harness/unittests/typingsInstaller.ts +++ b/src/harness/unittests/typingsInstaller.ts @@ -3,9 +3,13 @@ /// /// /// -/// +/// namespace ts.projectSystem { + import spy = typemock.spy; + import Arg = typemock.Arg; + import Times = typemock.Times; + import TI = server.typingsInstaller; import validatePackageName = JsTyping.validatePackageName; import PackageNameValidationResult = JsTyping.PackageNameValidationResult; @@ -40,19 +44,14 @@ namespace ts.projectSystem { } } - function executeCommand(self: Installer, host: TestServerHost | mocks.MockServerHost, installedTypings: string[] | string, typingFiles: FileOrFolder[], cb: TI.RequestCompletedAction): void { + function executeCommand(self: Installer, host: fakes.FakeServerHost, installedTypings: string[] | string, typingFiles: FileOrFolder[], cb: TI.RequestCompletedAction): void { self.addPostExecAction(installedTypings, success => { for (const file of typingFiles) { - if (host instanceof mocks.MockServerHost) { - if (typeof file.content === "string") { - host.vfs.addFile(file.path, file.content, { overwrite: true }); - } - else { - host.vfs.addDirectory(file.path); - } + if (typeof file.content === "string") { + host.vfs.addFile(file.path, file.content, { overwrite: true }); } else { - host.ensureFileOrFolder(file); + host.vfs.addDirectory(file.path); } } cb(success); @@ -75,27 +74,24 @@ namespace ts.projectSystem { describe("local module", () => { it("should not be picked up", () => { - const host = new mocks.MockServerHost(); + const host = new fakes.FakeServerHost(); const f1 = host.vfs.addFile("/a/app.js", `const c = require('./config');`); const f2 = host.vfs.addFile("/a/config.js", `export let x = 1`); const config = host.vfs.addFile("/a/jsconfig.json", `{ "typeAcquisition": { "enable": true }, "compilerOptions": { "moduleResolution": "commonjs } }`); host.vfs.addFile("/cache/node_modules/@types/config/index.d.ts", `export let y: number;`); - const installer = new class extends Installer { - constructor() { - super(host, { typesRegistry: createTypesRegistry("config"), globalTypingsCacheLocation: "/cache" }); - } - - installWorker(_requestId: number, _args: string[], _cwd: string, _cb: TI.RequestCompletedAction) { - assert(false, "should not be called"); - } - }; + const installer = new Installer(host, { typesRegistry: createTypesRegistry("config"), globalTypingsCacheLocation: "/cache" }); + const installWorkerSpy = spy(installer, "installWorker"); const service = createProjectService(host, { typingsInstaller: installer }); service.openClientFile(f1.path); service.checkNumberOfProjects({ configuredProjects: 1 }); checkProjectActualFiles(configuredProjectAt(service, 0), [f1.path, f2.path, config.path]); installer.installAll(0); + + installWorkerSpy + .verify(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), Times.none()) + .revoke(); }); }); @@ -106,22 +102,20 @@ namespace ts.projectSystem { content: "declare const $: { x: number }" }; - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file1 = host.vfs.addFile("/a/b/app.js", ``); const tsconfig = host.vfs.addFile("/a/b/tsconfig.json", `{ "compilerOptions": { "allowJs": true }, "typeAcquisition": { "enable": true } }`); host.vfs.addFile("/a/b/package.json", `{ "name": "test", "dependencies": { "jquery": "^3.1.0" } }`); - 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 installer = new Installer(host, { typesRegistry: createTypesRegistry("jquery") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + const installedTypings = ["@types/jquery"]; + const typingFiles = [jquery]; + executeCommand(installer, host, installedTypings, typingFiles, cb); + } + }); const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); projectService.openClientFile(file1.path); @@ -135,6 +129,8 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { configuredProjects: 1 }); host.checkTimeoutQueueLengthAndRun(2); checkProjectActualFiles(p, [file1.path, jquery.path, tsconfig.path]); + + installWorkerSpy.revoke(); }); it("inferred project (typings installed)", () => { @@ -143,21 +139,19 @@ namespace ts.projectSystem { content: "declare const $: { x: number }" }; - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file1 = host.vfs.addFile("/a/b/app.js", ``); host.vfs.addFile("/a/b/package.json", `{ "name": "test", "dependencies": { "jquery": "^3.1.0" } }`); - 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 installer = new Installer(host, { typesRegistry: createTypesRegistry("jquery") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + const installedTypings = ["@types/jquery"]; + const typingFiles = [jquery]; + executeCommand(installer, host, installedTypings, typingFiles, cb); + } + }); const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); projectService.openClientFile(file1.path); @@ -170,21 +164,16 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { inferredProjects: 1 }); checkProjectActualFiles(p, [file1.path, jquery.path]); + + installWorkerSpy.revoke(); }); it("external project - no type acquisition, no .d.ts/js files", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file1 = host.vfs.addFile("/a/b/app.ts", ``); - const installer = new class extends Installer { - constructor() { - super(host); - } - - enqueueInstallTypingsRequest() { - assert(false, "auto discovery should not be enabled"); - } - }; + const installer = new Installer(host); + const enqueueInstallTypingsRequestSpy = spy(installer, "enqueueInstallTypingsRequest"); const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -198,19 +187,18 @@ namespace ts.projectSystem { // by default auto discovery will kick in if project contain only .js/.d.ts files // in this case project contain only ts files - no auto discovery projectService.checkNumberOfProjects({ externalProjects: 1 }); + + enqueueInstallTypingsRequestSpy + .verify(_ => _(Arg.any(), Arg.any(), Arg.any()), Times.none(), "auto discovery should not be enabled") + .revoke(); }); it("external project - no auto in typing acquisition, no .d.ts/js files", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file1 = host.vfs.addFile("/a/b/app.ts", ``); - const installer = new class extends Installer { - constructor() { - super(host, { typesRegistry: createTypesRegistry("jquery") }); - } - enqueueInstallTypingsRequest() { - assert(false, "auto discovery should not be enabled"); - } - }; + + const installer = new Installer(host, { typesRegistry: createTypesRegistry("jquery") }); + const enqueueInstallTypingsRequestSpy = spy(installer, "enqueueInstallTypingsRequest"); const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -224,10 +212,14 @@ namespace ts.projectSystem { // by default auto discovery will kick in if project contain only .js/.d.ts files // in this case project contain only ts files - no auto discovery even if type acquisition is set projectService.checkNumberOfProjects({ externalProjects: 1 }); + + enqueueInstallTypingsRequestSpy + .verify(_ => _(Arg.any(), Arg.any(), Arg.any()), Times.none(), "auto discovery should not be enabled") + .revoke(); }); it("external project - autoDiscovery = true, no .d.ts/js files", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file1 = host.vfs.addFile("/a/b/app.ts", ``); const jquery = { @@ -235,21 +227,16 @@ namespace ts.projectSystem { content: "declare const $: { x: number }" }; - let enqueueIsCalled = false; - const installer = new class extends Installer { - constructor() { - super(host, { typesRegistry: createTypesRegistry("jquery") }); - } - enqueueInstallTypingsRequest(project: server.Project, typeAcquisition: TypeAcquisition, unresolvedImports: server.SortedReadonlyArray) { - enqueueIsCalled = true; - super.enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction): void { - const installedTypings = ["@types/node"]; - const typingFiles = [jquery]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { typesRegistry: createTypesRegistry("jquery") }); + const enqueueInstallTypingsRequestSpy = spy(installer, "enqueueInstallTypingsRequest"); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + const installedTypings = ["@types/jquery"]; + const typingFiles = [jquery]; + executeCommand(installer, host, installedTypings, typingFiles, cb); + } + }); const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -260,11 +247,16 @@ namespace ts.projectSystem { typeAcquisition: { enable: true, include: ["jquery"] } }); - assert.isTrue(enqueueIsCalled, "expected enqueueIsCalled to be true"); installer.installAll(/*expectedCount*/ 1); // auto is set in type acquisition - use it even if project contains only .ts files projectService.checkNumberOfProjects({ externalProjects: 1 }); + + enqueueInstallTypingsRequestSpy + .verify(_ => _(Arg.any(), Arg.any(), Arg.any()), Times.atLeastOnce()) + .revoke(); + + installWorkerSpy.revoke(); }); it("external project - no type acquisition, with only js, jsx, d.ts files", () => { @@ -272,7 +264,7 @@ namespace ts.projectSystem { // 1. react typings are installed for .jsx // 2. loose files names are matched against safe list for typings if // this is a JS project (only js, jsx, d.ts files are present) - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file1 = host.vfs.addFile("/a/b/lodash.js", ``); const file2 = host.vfs.addFile("/a/b/file2.jsx", ``); const file3 = host.vfs.addFile("/a/b/file3.d.ts", ``); @@ -287,16 +279,15 @@ namespace ts.projectSystem { content: "declare const lodash: { x: number }" }; - const installer = new class extends Installer { - constructor() { - super(host, { typesRegistry: createTypesRegistry("lodash", "react") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction): void { - const installedTypings = ["@types/lodash", "@types/react"]; - const typingFiles = [lodash, react]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { typesRegistry: createTypesRegistry("lodash", "react") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + const installedTypings = ["@types/lodash", "@types/react"]; + const typingFiles = [lodash, react]; + executeCommand(installer, host, installedTypings, typingFiles, cb); + } + }); const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -317,28 +308,24 @@ namespace ts.projectSystem { host.checkTimeoutQueueLengthAndRun(2); checkNumberOfProjects(projectService, { externalProjects: 1 }); checkProjectActualFiles(p, [file1.path, file2.path, file3.path, lodash.path, react.path]); + + installWorkerSpy.revoke(); }); it("external project - no type acquisition, with js & ts files", () => { // Tests: // 1. No typings are included for JS projects when the project contains ts files - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file1 = host.vfs.addFile("/a/b/jquery.js", ``); const file2 = host.vfs.addFile("/a/b/file2.ts", ``); - const installer = new class extends Installer { - constructor() { - super(host, { typesRegistry: createTypesRegistry("jquery") }); - } - enqueueInstallTypingsRequest(project: server.Project, typeAcquisition: TypeAcquisition, unresolvedImports: server.SortedReadonlyArray) { - super.enqueueInstallTypingsRequest(project, typeAcquisition, unresolvedImports); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction): void { - const installedTypings: string[] = []; - const typingFiles: FileOrFolder[] = []; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { typesRegistry: createTypesRegistry("jquery") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, [], [], cb); + } + }); const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -357,6 +344,7 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { externalProjects: 1 }); checkProjectActualFiles(p, [file2.path]); + installWorkerSpy.revoke(); }); it("external project - with type acquisition, with only js, d.ts files", () => { @@ -364,7 +352,7 @@ namespace ts.projectSystem { // 1. Safelist matching, type acquisition includes/excludes and package.json typings are all acquired // 2. Types for safelist matches are not included when they also appear in the type acquisition exclude list // 3. Multiple includes and excludes are respected in type acquisition - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file1 = host.vfs.addFile("/a/b/lodash.js", ``); const file2 = host.vfs.addFile("/a/b/commander.js", ``); const file3 = host.vfs.addFile("/a/b/file3.d.ts", ``); @@ -388,16 +376,15 @@ namespace ts.projectSystem { content: "declare const moment: { x: number }" }; - const installer = new class extends Installer { - constructor() { - super(host, { typesRegistry: createTypesRegistry("jquery", "commander", "moment", "express") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction): void { - const installedTypings = ["@types/commander", "@types/express", "@types/jquery", "@types/moment"]; - const typingFiles = [commander, express, jquery, moment]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { typesRegistry: createTypesRegistry("jquery", "commander", "moment", "express") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + const installedTypings = ["@types/commander", "@types/express", "@types/jquery", "@types/moment"]; + const typingFiles = [commander, express, jquery, moment]; + executeCommand(installer, host, installedTypings, typingFiles, cb); + } + }); const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -418,10 +405,11 @@ namespace ts.projectSystem { host.checkTimeoutQueueLengthAndRun(2); checkNumberOfProjects(projectService, { externalProjects: 1 }); checkProjectActualFiles(p, [file1.path, file2.path, file3.path, commander.path, express.path, jquery.path, moment.path]); + installWorkerSpy.revoke(); }); it("Throttle - delayed typings to install", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const lodashJs = host.vfs.addFile("/a/b/lodash.js", ``); const commanderJs = host.vfs.addFile("/a/b/commander.js", ``); const file3 = host.vfs.addFile("/a/b/file3.d.ts", ``); @@ -450,15 +438,14 @@ namespace ts.projectSystem { }; const typingFiles = [commander, express, jquery, moment, lodash]; - const installer = new class extends Installer { - constructor() { - super(host, { throttleLimit: 3, typesRegistry: createTypesRegistry("commander", "express", "jquery", "moment", "lodash") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction): void { - const installedTypings = ["@types/commander", "@types/express", "@types/jquery", "@types/moment", "@types/lodash"]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { typesRegistry: createTypesRegistry("commander", "express", "jquery", "moment", "lodash") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + const installedTypings = ["@types/commander", "@types/express", "@types/jquery", "@types/moment", "@types/lodash"]; + executeCommand(installer, host, installedTypings, typingFiles, cb); + } + }); const projectFileName = "/a/app/test.csproj"; const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -481,10 +468,11 @@ namespace ts.projectSystem { host.checkTimeoutQueueLengthAndRun(2); checkNumberOfProjects(projectService, { externalProjects: 1 }); checkProjectActualFiles(p, [lodashJs.path, commanderJs.path, file3.path, commander.path, express.path, jquery.path, moment.path, lodash.path]); + installWorkerSpy.revoke(); }); it("Throttle - delayed run install requests", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const lodashJs = host.vfs.addFile("/a/b/lodash.js", ``); const commanderJs = host.vfs.addFile("/a/b/commander.js", ``); const file3 = host.vfs.addFile("/a/b/file3.d.ts", ``); @@ -521,21 +509,18 @@ namespace ts.projectSystem { typings: typingsName("gulp") }; - const installer = new class extends Installer { - constructor() { - super(host, { throttleLimit: 1, typesRegistry: createTypesRegistry("commander", "jquery", "lodash", "cordova", "gulp", "grunt") }); - } - installWorker(_requestId: number, args: string[], _cwd: string, cb: TI.RequestCompletedAction): void { - let typingFiles: (FileOrFolder & { typings: string })[] = []; - if (args.indexOf(typingsName("commander")) >= 0) { - typingFiles = [commander, jquery, lodash, cordova]; + const installer = new Installer(host, { throttleLimit: 1, typesRegistry: createTypesRegistry("commander", "jquery", "lodash", "cordova", "gulp", "grunt") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.includes(typingsName("commander")), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, [commander.typings, jquery.typings, lodash.typings, cordova.typings], [commander, jquery, lodash, cordova], cb); } - else { - typingFiles = [grunt, gulp]; + }) + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, [grunt.typings, gulp.typings], [grunt, gulp], cb); } - executeCommand(this, host, typingFiles.map(f => f.typings), typingFiles, cb); - } - }; + }); // Create project #1 with 4 typings const projectService = createProjectService(host, { typingsInstaller: installer }); @@ -576,6 +561,7 @@ namespace ts.projectSystem { host.checkTimeoutQueueLengthAndRun(3); checkProjectActualFiles(p1, [lodashJs.path, commanderJs.path, file3.path, commander.path, jquery.path, lodash.path, cordova.path]); checkProjectActualFiles(p2, [file3.path, grunt.path, gulp.path]); + installWorkerSpy.revoke(); }); it("configured projects discover from node_modules", () => { @@ -583,7 +569,7 @@ namespace ts.projectSystem { path: "/tmp/node_modules/@types/jquery/index.d.ts", content: "" }; - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const app = host.vfs.addFile("/app.js", ``); const jsconfig = host.vfs.addFile("/jsconfig.json", `{}`); host.vfs.addFile("/node_modules/jquery/index.js", ``); @@ -591,17 +577,13 @@ namespace ts.projectSystem { // Should not search deeply in node_modules. host.vfs.addFile("/node_modules/jquery/nested/package.json", `{ "name": "nested" }`); - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery", "nested") }); - } - installWorker(_requestId: number, args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - assert.deepEqual(args, [`@types/jquery@ts${versionMajorMinor}`]); - const installedTypings = ["@types/jquery"]; - const typingFiles = [jqueryDTS]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery", "nested") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.array([`@types/jquery@ts${versionMajorMinor}`]), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, ["@types/jquery"], [jqueryDTS], cb); + } + }); const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); projectService.openClientFile(app.path); @@ -615,10 +597,13 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { configuredProjects: 1 }); host.checkTimeoutQueueLengthAndRun(2); checkProjectActualFiles(p, [app.path, jqueryDTS.path, jsconfig.path]); + installWorkerSpy + .verify(_ => _(Arg.any(), Arg.not(Arg.array([`@types/jquery@ts${versionMajorMinor}`])), Arg.any(), Arg.any()), Times.none()) + .revoke(); }); it("configured projects discover from bower_components", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const app = host.vfs.addFile("/app.js", ``); const jsconfig = host.vfs.addFile("/jsconfig.json", `{}`); host.vfs.addFile("/bower_components/jquery/index.js", ``); @@ -629,16 +614,13 @@ namespace ts.projectSystem { content: "" }; - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - const installedTypings = ["@types/jquery"]; - const typingFiles = [jqueryDTS]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, ["@types/jquery"], [jqueryDTS], cb); + } + }); const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); projectService.openClientFile(app.path); @@ -653,10 +635,11 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { configuredProjects: 1 }); host.checkTimeoutQueueLengthAndRun(2); checkProjectActualFiles(p, [app.path, jqueryDTS.path, jsconfig.path]); + installWorkerSpy.revoke(); }); it("configured projects discover from bower.json", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const app = host.vfs.addFile("/app.js", ``); const jsconfig = host.vfs.addFile("/jsconfig.json", `{}`); host.vfs.addFile("/bower.json", `{ "dependencies": { "jquery": "^3.1.0" } }`); @@ -666,16 +649,13 @@ namespace ts.projectSystem { content: "" }; - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - const installedTypings = ["@types/jquery"]; - const typingFiles = [jqueryDTS]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("jquery") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, ["@types/jquery"], [jqueryDTS], cb); + } + }); const projectService = createProjectService(host, { useSingleInferredProject: true, typingsInstaller: installer }); projectService.openClientFile(app.path); @@ -689,10 +669,11 @@ namespace ts.projectSystem { checkNumberOfProjects(projectService, { configuredProjects: 1 }); host.checkTimeoutQueueLengthAndRun(2); checkProjectActualFiles(p, [app.path, jqueryDTS.path, jsconfig.path]); + installWorkerSpy.revoke(); }); it("Malformed package.json should be watched", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const f = host.vfs.addFile("/a/b/app.js", `var x = 1`); host.vfs.addFile("/a/b/package.json", `{ "dependencies": { "co } }`); @@ -702,16 +683,13 @@ namespace ts.projectSystem { content: "export let x: number" }; - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - const installedTypings = ["@types/commander"]; - const typingFiles = [commander]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, ["@types/commander"], [commander], cb); + } + }); const service = createProjectService(host, { typingsInstaller: installer }); service.openClientFile(f.path); @@ -729,10 +707,11 @@ namespace ts.projectSystem { service.checkNumberOfProjects({ inferredProjects: 1 }); checkProjectActualFiles(service.inferredProjects[0], [f.path, commander.path]); + installWorkerSpy.revoke(); }); it("should install typings for unresolved imports", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const file = host.vfs.addFile("/a/b/app.js", `import * as fs from "fs";\n` + `import * as commander from "commander";`); @@ -747,16 +726,13 @@ namespace ts.projectSystem { content: "export let y: string" }; - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("node", "commander") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - const installedTypings = ["@types/node", "@types/commander"]; - const typingFiles = [node, commander]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - }; + const installer = new Installer(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("node", "commander") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, ["@types/node", "@types/commander"], [node, commander], cb); + } + }); const service = createProjectService(host, { typingsInstaller: installer }); service.openClientFile(file.path); @@ -770,10 +746,11 @@ namespace ts.projectSystem { assert.isTrue(host.fileExists(commander.path), "typings for 'commander' should be created"); checkProjectActualFiles(service.inferredProjects[0], [file.path, node.path, commander.path]); + installWorkerSpy.revoke(); }); it("should pick typing names from non-relative unresolved imports", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const f1 = host.vfs.addFile("/a/b/app.js", `import * as a from "foo/a/a";\n` + `import * as b from "foo/a/b";\n` + @@ -783,14 +760,13 @@ namespace ts.projectSystem { `import * as e from "@bar/common/apps";\n` + `import * as f from "./lib"`); - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("foo") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - executeCommand(this, host, ["foo"], [], cb); - } - }; + const installer = new Installer(host, { globalTypingsCacheLocation: "/tmp", typesRegistry: createTypesRegistry("foo") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, ["foo"], [], cb); + } + }); const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); @@ -805,10 +781,11 @@ namespace ts.projectSystem { ); installer.installAll(/*expectedCount*/ 1); + installWorkerSpy.revoke(); }); it("cached unresolved typings are not recomputed if program structure did not change", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const session = createSession(host); const f = { path: "/a/app.js", @@ -879,25 +856,23 @@ namespace ts.projectSystem { describe("Invalid package names", () => { it("should not be installed", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const f1 = host.vfs.addFile("/a/b/app.js", `let x = 1`); host.vfs.addFile("/a/b/package.json", `{ "dependencies": { "; say ‘Hello from TypeScript!’ #": "0.0.x" } }`); const messages: string[] = []; - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: "/tmp" }, { isEnabled: () => true, writeLine: msg => messages.push(msg) }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, _cb: TI.RequestCompletedAction) { - assert(false, "runCommand should not be invoked"); - } - }; + const installer = new Installer(host, { globalTypingsCacheLocation: "/tmp" }, { isEnabled: () => true, writeLine: msg => messages.push(msg) }); + const installWorkerSpy = spy(installer, "installWorker"); const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); installer.checkPendingCommands(/*expectedCount*/ 0); assert.isTrue(messages.indexOf("Package name '; say ‘Hello from TypeScript!’ #' contains non URI safe characters") > 0, "should find package with invalid name"); + + installWorkerSpy + .verify(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), Times.none()) + .revoke(); }); }); @@ -905,7 +880,7 @@ namespace ts.projectSystem { const emptySafeList = emptyMap; it("should use mappings from safe list", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const app = host.vfs.addFile("/a/b/app.js", ``); const jquery = host.vfs.addFile("/a/b/jquery.js", ``); const chroma = host.vfs.addFile("/a/b/chroma.min.js", ``); @@ -925,7 +900,7 @@ namespace ts.projectSystem { }); it("should return node for core modules", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const f = host.vfs.addFile("/a/b/app.js", ``); const cache = createMap(); @@ -942,7 +917,7 @@ namespace ts.projectSystem { }); it("should use cached locations", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const f = host.vfs.addFile("/a/b/app.js", ``); const node = host.vfs.addFile("/a/b/node.d.ts", ``); @@ -958,7 +933,7 @@ namespace ts.projectSystem { }); it("should search only 2 levels deep", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const app = host.vfs.addFile("/app.js"); host.vfs.addFile("/node_modules/a/package.json", `{ "name": "a" }`); host.vfs.addFile("/node_modules/a/b/package.json", `{ "name": "b" }`); @@ -982,7 +957,7 @@ namespace ts.projectSystem { describe("telemetry events", () => { it("should be received", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const f1 = host.vfs.addFile("/a/app.js", ``); host.vfs.addFile("/a/package.json", `{ "dependencies": { "commander": "1.0.0" } }`); @@ -992,35 +967,30 @@ namespace ts.projectSystem { content: "export let x: number" }; - let seenTelemetryEvent = false; - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - const installedTypings = ["@types/commander"]; - const typingFiles = [commander]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - sendResponse(response: server.SetTypings | server.InvalidateCachedTypings | server.BeginInstallTypes | server.EndInstallTypes) { - if (response.kind === server.EventBeginInstallTypes) { - return; - } - if (response.kind === server.EventEndInstallTypes) { - assert.deepEqual(response.packagesToInstall, [typingsName("commander")]); - seenTelemetryEvent = true; - return; + const installer = new Installer(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, ["@types/commander"], [commander], cb); } - super.sendResponse(response); - } - }; + }); + const sendResponseSpy = spy(installer, "sendResponse") + .setup(_ => _(Arg.is(response => response.kind === server.EventBeginInstallTypes))) + .setup(_ => _(Arg.is(response => response.kind === server.EventEndInstallTypes))) + .setup(_ => _(Arg.any()), { fallback: true }); const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); installer.installAll(/*expectedCount*/ 1); - assert.isTrue(seenTelemetryEvent); + installWorkerSpy.revoke(); + sendResponseSpy + .verify(_ => _(Arg.is(response => response.kind === server.EventEndInstallTypes && + response.packagesToInstall.length === 1 && + response.packagesToInstall[0] === typingsName("commander")))) + .revoke(); + host.checkTimeoutQueueLengthAndRun(2); checkNumberOfProjects(projectService, { inferredProjects: 1 }); checkProjectActualFiles(projectService.inferredProjects[0], [f1.path, commander.path]); @@ -1029,7 +999,7 @@ namespace ts.projectSystem { describe("progress notifications", () => { it("should be sent for success", () => { - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const f1 = host.vfs.addFile("/a/app.js", ``); host.vfs.addFile("/a/package.json", `{ "dependencies": { "commander": "1.0.0" } }`); @@ -1041,35 +1011,29 @@ namespace ts.projectSystem { let beginEvent: server.BeginInstallTypes; let endEvent: server.EndInstallTypes; - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - const installedTypings = ["@types/commander"]; - const typingFiles = [commander]; - executeCommand(this, host, installedTypings, typingFiles, cb); - } - sendResponse(response: server.SetTypings | server.InvalidateCachedTypings | server.BeginInstallTypes | server.EndInstallTypes) { - if (response.kind === server.EventBeginInstallTypes) { - beginEvent = response; - return; + const installer = new Installer(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, ["@types/commander"], [commander], cb); } - if (response.kind === server.EventEndInstallTypes) { - endEvent = response; - return; - } - super.sendResponse(response); - } - }; + }); + const sendResponseSpy = spy(installer, "sendResponse") + .setup(_ => _(Arg.is(response => response.kind === server.EventBeginInstallTypes)), { callback: response => { beginEvent = response; } }) + .setup(_ => _(Arg.is(response => response.kind === server.EventEndInstallTypes)), { callback: response => { endEvent = response; } }) + .setup(_ => _(Arg.any()), { fallback: true }); const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); installer.installAll(/*expectedCount*/ 1); - assert.isTrue(!!beginEvent); - assert.isTrue(!!endEvent); + installWorkerSpy.revoke(); + sendResponseSpy + .verify(_ => _(Arg.is(response => response.kind === server.EventBeginInstallTypes))) + .verify(_ => _(Arg.is(response => response.kind === server.EventEndInstallTypes))) + .revoke(); + assert.isTrue(beginEvent.eventId === endEvent.eventId); assert.isTrue(endEvent.installSuccess); host.checkTimeoutQueueLengthAndRun(2); @@ -1079,40 +1043,37 @@ namespace ts.projectSystem { it("should be sent for error", () => { // const host = createServerHost([f1, packageFile]); - const host = new mocks.MockServerHost({ safeList: true }); + const host = new fakes.FakeServerHost({ safeList: true }); const f1 = host.vfs.addFile("/a/app.js", ``); host.vfs.addFile("/a/package.json", `{ "dependencies": { "commander": "1.0.0" } }`); const cachePath = "/a/cache/"; + let beginEvent: server.BeginInstallTypes; let endEvent: server.EndInstallTypes; - const installer = new class extends Installer { - constructor() { - super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); - } - installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) { - executeCommand(this, host, "", [], cb); - } - sendResponse(response: server.SetTypings | server.InvalidateCachedTypings | server.BeginInstallTypes | server.EndInstallTypes) { - if (response.kind === server.EventBeginInstallTypes) { - beginEvent = response; - return; - } - if (response.kind === server.EventEndInstallTypes) { - endEvent = response; - return; + const installer = new Installer(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("commander") }); + const installWorkerSpy = spy(installer, "installWorker") + .setup(_ => _(Arg.any(), Arg.any(), Arg.any(), Arg.any()), { + callback: (_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) => { + executeCommand(installer, host, "", [], cb); } - super.sendResponse(response); - } - }; + }); + const sendResponseSpy = spy(installer, "sendResponse") + .setup(_ => _(Arg.is(response => response.kind === server.EventBeginInstallTypes)), { callback: response => { beginEvent = response; } }) + .setup(_ => _(Arg.is(response => response.kind === server.EventEndInstallTypes)), { callback: response => { endEvent = response; } }) + .setup(_ => _(Arg.any()), { fallback: true }); const projectService = createProjectService(host, { typingsInstaller: installer }); projectService.openClientFile(f1.path); installer.installAll(/*expectedCount*/ 1); - assert.isTrue(!!beginEvent); - assert.isTrue(!!endEvent); + installWorkerSpy.revoke(); + sendResponseSpy + .verify(_ => _(Arg.is(response => response.kind === server.EventBeginInstallTypes))) + .verify(_ => _(Arg.is(response => response.kind === server.EventEndInstallTypes))) + .revoke(); + assert.isTrue(beginEvent.eventId === endEvent.eventId); assert.isFalse(endEvent.installSuccess); checkNumberOfProjects(projectService, { inferredProjects: 1 }); diff --git a/src/harness/vfs.ts b/src/harness/vfs.ts index aa2cc0e6e104b..07a187f1030d7 100644 --- a/src/harness/vfs.ts +++ b/src/harness/vfs.ts @@ -209,7 +209,7 @@ namespace vfs { } private get watchedDirectoriesPrivate() { - return this._watchedDirectories || (this._watchedDirectories = new core.KeyedCollection(this.pathComparer)) + return this._watchedDirectories || (this._watchedDirectories = new core.KeyedCollection(this.pathComparer)); } private get watchedRecursiveDirectoriesSetPrivate() { diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index b4b8a8141f018..aac9b7503371e 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -1,5 +1,5 @@ /// -/// +/// // TODO(rbuckton): Migrate this to use vfs. @@ -41,34 +41,6 @@ interface Array {}` useWindowsStylePaths?: boolean; } - export function createWatchedSystem(fileOrFolderList: ReadonlyArray, params: TestServerHostCreationParameters = {}) { - // const host = new mocks.MockServerHost({ - // vfs: { - // currentDirectory: params.currentDirectory, - // useCaseSensitiveFileNames: params.useCaseSensitiveFileNames - // }, - // executingFilePath: params.executingFilePath, - // newLine: params.newLine as "\r\n" | "\n" - // }); - // for (const entry of fileOrFolderList) { - // if (typeof entry.content === "string") { - // host.vfs.addFile(entry.path, entry.content); - // } - // else { - // host.vfs.addDirectory(entry.path); - // } - // } - // if (params.useWindowsStylePaths) throw new Error("Not supported"); - const host = new TestServerHost(/*withSafelist*/ false, - params.useCaseSensitiveFileNames !== undefined ? params.useCaseSensitiveFileNames : false, - params.executingFilePath || getExecutingFilePathFromLibFile(), - params.currentDirectory || "/", - fileOrFolderList, - params.newLine, - params.useWindowsStylePaths); - return host; - } - export function createServerHost(fileOrFolderList: ReadonlyArray, params?: TestServerHostCreationParameters): TestServerHost { if (!params) { params = {}; @@ -174,22 +146,22 @@ interface Array {}` } } - export function checkWatchedFiles(host: TestServerHost | mocks.MockServerHost, expectedFiles: string[]) { - if (host instanceof mocks.MockServerHost) { + export function checkWatchedFiles(host: TestServerHost | fakes.FakeServerHost, expectedFiles: string[]) { + if (host instanceof fakes.FakeServerHost) { return checkSortedSet(host.vfs.watchedFiles, expectedFiles); } checkMapKeys("watchedFiles", host.watchedFiles, expectedFiles); } - export function checkWatchedDirectories(host: TestServerHost | mocks.MockServerHost, expectedDirectories: string[], recursive = false) { - if (host instanceof mocks.MockServerHost) { + export function checkWatchedDirectories(host: TestServerHost | fakes.FakeServerHost, expectedDirectories: string[], recursive = false) { + if (host instanceof fakes.FakeServerHost) { return checkSortedSet(recursive ? host.vfs.watchedRecursiveDirectories : host.vfs.watchedNonRecursiveDirectories, expectedDirectories); } checkMapKeys(`watchedDirectories${recursive ? " recursive" : ""}`, recursive ? host.watchedDirectoriesRecursive : host.watchedDirectories, expectedDirectories); } - export function checkOutputContains(host: TestServerHost | mocks.MockServerHost, expected: ReadonlyArray) { + export function checkOutputContains(host: TestServerHost | fakes.FakeServerHost, expected: ReadonlyArray) { const mapExpected = arrayToSet(expected); const mapSeen = createMap(); for (const f of host.getOutput()) { @@ -202,7 +174,7 @@ interface Array {}` assert.equal(mapExpected.size, 0, `Output has missing ${JSON.stringify(flatMapIter(mapExpected.keys(), key => key))} in ${JSON.stringify(host.getOutput())}`); } - export function checkOutputDoesNotContain(host: TestServerHost | mocks.MockServerHost, expectedToBeAbsent: string[] | ReadonlyArray) { + export function checkOutputDoesNotContain(host: TestServerHost | fakes.FakeServerHost, expectedToBeAbsent: string[] | ReadonlyArray) { const mapExpectedToBeAbsent = arrayToSet(expectedToBeAbsent); for (const f of host.getOutput()) { assert.isFalse(mapExpectedToBeAbsent.has(f), `Contains ${f} in ${JSON.stringify(host.getOutput())}`); diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 726621a540dc3..0d98d798c0ef7 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -537,7 +537,7 @@ namespace ts.server { } } - updateTypingsForProject(response: SetTypings | InvalidateCachedTypings): void { + updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | BeginInstallTypes | EndInstallTypes): void { const project = this.findProject(response.projectName); if (!project) { return; From c5e502009ffcf295876cb2f3029236edbea0047c Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 27 Nov 2017 15:00:05 -0800 Subject: [PATCH 16/54] Migrate tsserverProjectSystem to vfs --- scripts/typemock/src/timers.ts | 10 +- src/harness/fakes.ts | 61 +- src/harness/unittests/compileOnSave.ts | 2 + src/harness/unittests/extractTestHelpers.ts | 18 +- src/harness/unittests/telemetry.ts | 4 +- .../unittests/tsserverProjectSystem.ts | 10821 ++++++++-------- src/harness/unittests/typingsInstaller.ts | 3 +- src/harness/utils.ts | 48 + src/harness/vfs.ts | 3 +- src/harness/virtualFileSystemWithWatch.ts | 57 +- 10 files changed, 5616 insertions(+), 5411 deletions(-) diff --git a/scripts/typemock/src/timers.ts b/scripts/typemock/src/timers.ts index 7811290b6d3ea..2dd2278138724 100644 --- a/scripts/typemock/src/timers.ts +++ b/scripts/typemock/src/timers.ts @@ -124,12 +124,16 @@ export class Timers { * - Use `Timers.MAX_DEPTH` to continue processing nested `setImmediate` calls up to the maximum depth. */ public advance(ms: number, maxDepth = 0): number { - if (ms <= 0) throw new TypeError("Argument 'ms' out of range."); + if (ms < 0) throw new TypeError("Argument 'ms' out of range."); if (maxDepth < 0) throw new TypeError("Argument 'maxDepth' out of range."); let count = 0; const endTime = this._time + (ms | 0); while (true) { - count += this.executeImmediates(maxDepth); + if (maxDepth >= 0) { + count += this.executeImmediates(maxDepth); + maxDepth--; + } + const dueTimer = this.dequeueIfBefore(endTime); if (dueTimer) { this._time = dueTimer.due; @@ -150,7 +154,7 @@ export class Timers { * - Use `Timers.MAX_DEPTH` to continue processing nested `setImmediate` calls up to the maximum depth. */ public advanceToEnd(maxDepth = 0) { - return this.remainingTime > 0 ? this.advance(this.remainingTime, maxDepth) : 0; + return this.advance(this.remainingTime, maxDepth); } /** diff --git a/src/harness/fakes.ts b/src/harness/fakes.ts index 6fae365810453..125f0ec880457 100644 --- a/src/harness/fakes.ts +++ b/src/harness/fakes.ts @@ -30,11 +30,18 @@ namespace fakes { * Indicates whether to include a bare _lib.d.ts_. */ lib?: boolean; + /** + * Indicates whether to use DOS paths by default. + */ + dos?: boolean; } - export class FakeServerHost implements ts.server.ServerHost, ts.FormatDiagnosticsHost { + export class FakeServerHost implements ts.server.ServerHost, ts.FormatDiagnosticsHost, ts.ModuleResolutionHost { + public static readonly dosExecutingFilePath = "c:/.ts/tsc.js"; public static readonly defaultExecutingFilePath = "/.ts/tsc.js"; + public static readonly dosDefaultCurrentDirectory = "c:/"; public static readonly defaultCurrentDirectory = "/"; + public static readonly dosSafeListPath = "c:/safelist.json"; public static readonly safeListPath = "/safelist.json"; public static readonly safeListContent = `{\n` + @@ -46,6 +53,7 @@ namespace fakes { ` "chroma": "chroma-js"\n` + `}`; + public static readonly dosLibPath = "c:/.ts/lib.d.ts"; public static readonly libPath = "/.ts/lib.d.ts"; public static readonly libContent = `/// \n` + @@ -64,22 +72,32 @@ namespace fakes { private static readonly processExitSentinel = new Error("System exit"); private readonly _output: string[] = []; + private readonly _trace: string[] = []; private readonly _executingFilePath: string; private readonly _getCanonicalFileName: (file: string) => string; constructor(options: FakeServerHostOptions = {}) { const { + dos = false, vfs: _vfs = {}, - executingFilePath = FakeServerHost.defaultExecutingFilePath, + executingFilePath = dos + ? FakeServerHost.dosExecutingFilePath + : FakeServerHost.defaultExecutingFilePath, newLine = "\n", safeList = false, lib = false } = options; - const { currentDirectory = FakeServerHost.defaultCurrentDirectory, useCaseSensitiveFileNames = false } = _vfs; + const { + currentDirectory = dos + ? FakeServerHost.dosDefaultCurrentDirectory + : FakeServerHost.defaultCurrentDirectory, + useCaseSensitiveFileNames = false + } = _vfs; - this.vfs = _vfs instanceof vfs.VirtualFileSystem ? _vfs : - new vfs.VirtualFileSystem(currentDirectory, useCaseSensitiveFileNames); + this.vfs = _vfs instanceof vfs.VirtualFileSystem + ? _vfs + : new vfs.VirtualFileSystem(currentDirectory, useCaseSensitiveFileNames); this.useCaseSensitiveFileNames = this.vfs.useCaseSensitiveFileNames; this.newLine = newLine; @@ -87,11 +105,15 @@ namespace fakes { this._getCanonicalFileName = ts.createGetCanonicalFileName(this.useCaseSensitiveFileNames); if (safeList) { - this.vfs.addFile(FakeServerHost.safeListPath, FakeServerHost.safeListContent); + this.vfs.addFile( + dos ? FakeServerHost.dosSafeListPath : FakeServerHost.safeListPath, + FakeServerHost.safeListContent); } if (lib) { - this.vfs.addFile(FakeServerHost.libPath, FakeServerHost.libContent); + this.vfs.addFile( + dos ? FakeServerHost.dosLibPath : FakeServerHost.libPath, + FakeServerHost.libContent); } } @@ -143,6 +165,12 @@ namespace fakes { } // #endregion DirectoryStructureHost members + // #region ModuleResolutionHost members + public trace(message: string) { + this._trace.push(message); + } + // #endregion + // #region System members public readonly args: string[] = []; @@ -226,6 +254,14 @@ namespace fakes { this._output.length = 0; } + public getTrace(): ReadonlyArray { + return this._trace; + } + + public clearTrace() { + this._trace.length = 0; + } + public checkTimeoutQueueLength(expected: number) { const callbacksCount = this.timers.getPending({ kind: "timeout", ms: this.timers.remainingTime }).length; assert.equal(callbacksCount, expected, `expected ${expected} timeout callbacks queued but found ${callbacksCount}.`); @@ -236,6 +272,17 @@ namespace fakes { this.runQueuedTimeoutCallbacks(); } + public runQueuedImmediateCallbacks() { + try { + this.timers.executeImmediates(); + } + catch (e) { + if (e !== FakeServerHost.processExitSentinel) { + throw e; + } + } + } + public runQueuedTimeoutCallbacks() { try { this.timers.advanceToEnd(); diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index d462d55b4bede..84c488770db5d 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -6,6 +6,8 @@ namespace ts.projectSystem { const nullCancellationToken = server.nullCancellationToken; + import libFile = ts.TestFSWithWatch.libFile; + import FileOrFolder = ts.TestFSWithWatch.FileOrFolder; function createTestTypingsInstaller(host: server.ServerHost) { return new TestTypingsInstaller("/a/data/", /*throttleLimit*/5, host); diff --git a/src/harness/unittests/extractTestHelpers.ts b/src/harness/unittests/extractTestHelpers.ts index a04f443c3c902..93ea26426752c 100644 --- a/src/harness/unittests/extractTestHelpers.ts +++ b/src/harness/unittests/extractTestHelpers.ts @@ -1,5 +1,6 @@ /// /// +/// namespace ts { export interface Range { @@ -98,6 +99,19 @@ namespace ts { getCurrentDirectory: notImplemented, }; + function createServerHost(files: ts.TestFSWithWatch.FileOrFolder[], options?: Partial) { + const host = new fakes.FakeServerHost(options); + for (const file of files) { + if (isString(file.content)) { + host.vfs.writeFile(file.path, file.content); + } + else { + host.vfs.addDirectory(file.path); + } + } + return host; + } + export function testExtractSymbol(caption: string, text: string, baselineFolder: string, description: DiagnosticMessage, includeLib?: boolean) { const t = extractTest(text); const selectionRange = t.ranges.get("selection"); @@ -154,7 +168,7 @@ namespace ts { } function makeProgram(f: {path: string, content: string }, includeLib?: boolean) { - const host = projectSystem.createServerHost(includeLib ? [f, projectSystem.libFile] : [f]); // libFile is expensive to parse repeatedly - only test when required + const host = createServerHost(includeLib ? [f, ts.TestFSWithWatch.libFile] : [f]); // libFile is expensive to parse repeatedly - only test when required const projectService = projectSystem.createProjectService(host); projectService.openClientFile(f.path); const program = projectService.inferredProjects[0].getLanguageService().getProgram(); @@ -178,7 +192,7 @@ namespace ts { path: "/a.ts", content: t.source }; - const host = projectSystem.createServerHost([f, projectSystem.libFile]); + const host = ts.TestFSWithWatch.createServerHost([f, ts.TestFSWithWatch.libFile]); const projectService = projectSystem.createProjectService(host); projectService.openClientFile(f.path); const program = projectService.inferredProjects[0].getLanguageService().getProgram(); diff --git a/src/harness/unittests/telemetry.ts b/src/harness/unittests/telemetry.ts index 9bb2db738013d..b33274da9adbd 100644 --- a/src/harness/unittests/telemetry.ts +++ b/src/harness/unittests/telemetry.ts @@ -2,6 +2,8 @@ /// namespace ts.projectSystem { + import FileOrFolder = ts.TestFSWithWatch.FileOrFolder; + describe("project telemetry", () => { it("does nothing for inferred project", () => { const file = makeFile("/a.js"); @@ -235,7 +237,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/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 35358e14ad4f3..af6c99d7d89c3 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -1,18 +1,21 @@ /// /// /// +/// +/// +/// namespace ts.projectSystem { + import spy = typemock.spy; + import dedent = utils.dedent; import TI = server.typingsInstaller; 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 FileOrFolder = ts.TestFSWithWatch.FileOrFolder; + import checkFileNames = ts.TestFSWithWatch.checkFileNames; + import libFile = ts.TestFSWithWatch.libFile; + import checkWatchedFiles = ts.TestFSWithWatch.checkWatchedFiles; import checkWatchedDirectories = ts.TestFSWithWatch.checkWatchedDirectories; import safeList = ts.TestFSWithWatch.safeList; @@ -142,8 +145,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: fakes.FakeServerHost; + constructor(files: FileOrFolder[]) { this.host = createServerHost(files); this.session = createSession(this.host, { canUseEvents: true, @@ -283,6 +286,7 @@ namespace ts.projectSystem { checkNumberOfProjects(this, count); } } + export function createProjectService(host: server.ServerHost, parameters: CreateProjectServiceParameters = {}, options?: Partial) { const cancellationToken = parameters.cancellationToken || server.nullCancellationToken; const logger = parameters.logger || nullLogger; @@ -456,11 +460,11 @@ namespace ts.projectSystem { verifyDiagnostics(actual, []); } - function assertEvent(actualOutput: string, expectedEvent: protocol.Event, host: TestServerHost) { + function assertEvent(actualOutput: string, expectedEvent: protocol.Event, host: ts.System) { assert.equal(actualOutput, server.formatMessage(expectedEvent, nullLogger, Utils.byteLength, host.newLine)); } - function checkErrorMessage(host: TestServerHost, eventName: "syntaxDiag" | "semanticDiag", diagnostics: protocol.DiagnosticEventBody) { + function checkErrorMessage(host: fakes.FakeServerHost, eventName: "syntaxDiag" | "semanticDiag", diagnostics: protocol.DiagnosticEventBody) { const outputs = host.getOutput(); assert.isTrue(outputs.length >= 1, outputs.toString()); const event: protocol.Event = { @@ -472,7 +476,7 @@ namespace ts.projectSystem { assertEvent(outputs[0], event, host); } - function checkCompleteEvent(host: TestServerHost, numberOfCurrentEvents: number, expectedSequenceId: number) { + function checkCompleteEvent(host: fakes.FakeServerHost, numberOfCurrentEvents: number, expectedSequenceId: number) { const outputs = host.getOutput(); assert.equal(outputs.length, numberOfCurrentEvents, outputs.toString()); const event: protocol.RequestCompletedEvent = { @@ -486,7 +490,7 @@ namespace ts.projectSystem { assertEvent(outputs[numberOfCurrentEvents - 1], event, host); } - function checkProjectUpdatedInBackgroundEvent(host: TestServerHost, openFiles: string[]) { + function checkProjectUpdatedInBackgroundEvent(host: fakes.FakeServerHost, openFiles: string[]) { const outputs = host.getOutput(); assert.equal(outputs.length, 1, outputs.toString()); const event: protocol.ProjectsUpdatedInBackgroundEvent = { @@ -500,5458 +504,5439 @@ namespace ts.projectSystem { assertEvent(outputs[0], event, host); } - describe("tsserverProjectSystem", () => { - const commonFile1: FileOrFolder = { - path: "/a/b/commonFile1.ts", - content: "let x = 1" - }; - const commonFile2: FileOrFolder = { - path: "/a/b/commonFile2.ts", - content: "let y = 1" - }; - - it("create inferred project", () => { - const appFile: FileOrFolder = { - path: "/a/b/c/app.ts", - content: ` - import {f} from "./module" - console.log(f) - ` - }; - - const moduleFile: FileOrFolder = { - path: "/a/b/c/module.d.ts", - content: `export let x: number` - }; - const host = createServerHost([appFile, moduleFile, libFile]); - const projectService = createProjectService(host); - const { configFileName } = projectService.openClientFile(appFile.path); - - assert(!configFileName, `should not find config, got: '${configFileName}`); - checkNumberOfConfiguredProjects(projectService, 0); - checkNumberOfInferredProjects(projectService, 1); - - const project = projectService.inferredProjects[0]; - - checkFileNames("inferred project", project.getFileNames(), [appFile.path, libFile.path, moduleFile.path]); - const configFileLocations = ["/a/b/c/", "/a/b/", "/a/", "/"]; - const configFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]); - checkWatchedFiles(host, configFiles.concat(libFile.path, moduleFile.path)); - checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, ["/a/b/c", combinePaths(getDirectoryPath(appFile.path), nodeModulesAtTypes)], /*recursive*/ true); - }); - - it("can handle tsconfig file name with difference casing", () => { - const f1 = { - path: "/a/b/app.ts", - content: "let x = 1" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ - include: [] - }) - }; - - const host = createServerHost([f1, config], { useCaseSensitiveFileNames: false }); - const service = createProjectService(host); - const upperCaseConfigFilePath = combinePaths(getDirectoryPath(config.path).toUpperCase(), getBaseFileName(config.path)); - service.openExternalProject({ - projectFileName: "/a/b/project.csproj", - rootFiles: toExternalFiles([f1.path, upperCaseConfigFilePath]), - options: {} - }); - service.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(service, 0), [upperCaseConfigFilePath]); - - service.openClientFile(f1.path); - service.checkNumberOfProjects({ configuredProjects: 1, inferredProjects: 1 }); - - checkProjectActualFiles(configuredProjectAt(service, 0), [upperCaseConfigFilePath]); - checkProjectActualFiles(service.inferredProjects[0], [f1.path]); - }); - - it("create configured project without file list", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: ` - { - "compilerOptions": {}, - "exclude": [ - "e" - ] - }` - }; - const file1: FileOrFolder = { - path: "/a/b/c/f1.ts", - content: "let x = 1" - }; - const file2: FileOrFolder = { - path: "/a/b/d/f2.ts", - content: "let y = 1" - }; - const file3: FileOrFolder = { - path: "/a/b/e/f3.ts", - content: "let z = 1" - }; - - const host = createServerHost([configFile, libFile, file1, file2, file3]); - const projectService = createProjectService(host); - const { configFileName, configFileErrors } = projectService.openClientFile(file1.path); - - assert(configFileName, "should find config file"); - assert.isTrue(!configFileErrors || configFileErrors.length === 0, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); - checkNumberOfInferredProjects(projectService, 0); - checkNumberOfConfiguredProjects(projectService, 1); - - const project = configuredProjectAt(projectService, 0); - checkProjectActualFiles(project, [file1.path, libFile.path, file2.path, configFile.path]); - checkProjectRootFiles(project, [file1.path, file2.path]); - // watching all files except one that was open - checkWatchedFiles(host, [configFile.path, file2.path, libFile.path]); - const configFileDirectory = getDirectoryPath(configFile.path); - checkWatchedDirectories(host, [configFileDirectory, combinePaths(configFileDirectory, nodeModulesAtTypes)], /*recursive*/ true); - }); + function createServerHost(files: FileOrFolder[], options?: Partial) { + const host = new fakes.FakeServerHost(options); + for (const file of files) { + if (isString(file.content)) { + host.vfs.writeFile(file.path, file.content); + } + else { + host.vfs.addDirectory(file.path); + } + } + return host; + } - it("create configured project with the file list", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: ` - { - "compilerOptions": {}, - "include": ["*.ts"] - }` - }; - const file1: FileOrFolder = { - path: "/a/b/f1.ts", + describe("tsserverProjectSystem", () => { + describe("general", () => { + const commonFile1: FileOrFolder = { + path: "/a/b/commonFile1.ts", content: "let x = 1" }; - const file2: FileOrFolder = { - path: "/a/b/f2.ts", + const commonFile2: FileOrFolder = { + path: "/a/b/commonFile2.ts", content: "let y = 1" }; - const file3: FileOrFolder = { - path: "/a/b/c/f3.ts", - content: "let z = 1" - }; - - const host = createServerHost([configFile, libFile, file1, file2, file3]); - const projectService = createProjectService(host); - const { configFileName, configFileErrors } = projectService.openClientFile(file1.path); - - assert(configFileName, "should find config file"); - assert.isTrue(!configFileErrors || configFileErrors.length === 0, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); - checkNumberOfInferredProjects(projectService, 0); - checkNumberOfConfiguredProjects(projectService, 1); - - const project = configuredProjectAt(projectService, 0); - checkProjectActualFiles(project, [file1.path, libFile.path, file2.path, configFile.path]); - checkProjectRootFiles(project, [file1.path, file2.path]); - // watching all files except one that was open - checkWatchedFiles(host, [configFile.path, file2.path, libFile.path]); - checkWatchedDirectories(host, [getDirectoryPath(configFile.path)], /*recursive*/ false); - }); - - it("add and then remove a config file in a folder with loose files", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "files": ["commonFile1.ts"] - }` - }; - const filesWithoutConfig = [libFile, commonFile1, commonFile2]; - const host = createServerHost(filesWithoutConfig); - - const filesWithConfig = [libFile, commonFile1, commonFile2, configFile]; - const projectService = createProjectService(host); - projectService.openClientFile(commonFile1.path); - projectService.openClientFile(commonFile2.path); - - checkNumberOfInferredProjects(projectService, 2); - const configFileLocations = ["/", "/a/", "/a/b/"]; - const watchedFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]).concat(libFile.path); - checkWatchedFiles(host, watchedFiles); - - // Add a tsconfig file - host.reloadFS(filesWithConfig); - host.checkTimeoutQueueLengthAndRun(1); - checkNumberOfInferredProjects(projectService, 1); - checkNumberOfConfiguredProjects(projectService, 1); - checkWatchedFiles(host, watchedFiles); - - // remove the tsconfig file - host.reloadFS(filesWithoutConfig); - - checkNumberOfInferredProjects(projectService, 1); - host.checkTimeoutQueueLengthAndRun(1); // Refresh inferred projects - - checkNumberOfInferredProjects(projectService, 2); - checkNumberOfConfiguredProjects(projectService, 0); - checkWatchedFiles(host, watchedFiles); - }); - it("add new files to a configured project without file list", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - const host = createServerHost([commonFile1, libFile, configFile]); - const projectService = createProjectService(host); - projectService.openClientFile(commonFile1.path); - const configFileDir = getDirectoryPath(configFile.path); - checkWatchedDirectories(host, [configFileDir, combinePaths(configFileDir, nodeModulesAtTypes)], /*recursive*/ true); - checkNumberOfConfiguredProjects(projectService, 1); - - const project = configuredProjectAt(projectService, 0); - checkProjectRootFiles(project, [commonFile1.path]); - - // add a new ts file - host.reloadFS([commonFile1, commonFile2, libFile, configFile]); - host.checkTimeoutQueueLengthAndRun(2); - // project service waits for 250ms to update the project structure, therefore the assertion needs to wait longer. - checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); - }); + it("create inferred project", () => { + const host = new fakes.FakeServerHost({ lib: true }); + host.vfs.addFile("/a/b/c/app.ts", `import {f} from "./module"\nconsole.log(f)`); + host.vfs.addFile("/a/b/c/module.d.ts", `export let x: number`); - it("should ignore non-existing files specified in the config file", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {}, - "files": [ - "commonFile1.ts", - "commonFile3.ts" - ] - }` - }; - const host = createServerHost([commonFile1, commonFile2, configFile]); - const projectService = createProjectService(host); - projectService.openClientFile(commonFile1.path); - projectService.openClientFile(commonFile2.path); - - checkNumberOfConfiguredProjects(projectService, 1); - const project = configuredProjectAt(projectService, 0); - checkProjectRootFiles(project, [commonFile1.path]); - checkNumberOfInferredProjects(projectService, 1); - }); + const projectService = createProjectService(host); + const { configFileName } = projectService.openClientFile("/a/b/c/app.ts"); - it("remove not-listed external projects", () => { - const f1 = { - path: "/a/app.ts", - content: "let x = 1" - }; - const f2 = { - path: "/b/app.ts", - content: "let x = 1" - }; - const f3 = { - path: "/c/app.ts", - content: "let x = 1" - }; - const makeProject = (f: FileOrFolder) => ({ projectFileName: f.path + ".csproj", rootFiles: [toExternalFile(f.path)], options: {} }); - const p1 = makeProject(f1); - const p2 = makeProject(f2); - const p3 = makeProject(f3); - - const host = createServerHost([f1, f2, f3]); - const session = createSession(host); - - session.executeCommand({ - seq: 1, - type: "request", - command: "openExternalProjects", - arguments: { projects: [p1, p2] } - }); - - const projectService = session.getProjectService(); - checkNumberOfProjects(projectService, { externalProjects: 2 }); - assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName); - assert.equal(projectService.externalProjects[1].getProjectName(), p2.projectFileName); - - session.executeCommand({ - seq: 2, - type: "request", - command: "openExternalProjects", - arguments: { projects: [p1, p3] } - }); - checkNumberOfProjects(projectService, { externalProjects: 2 }); - assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName); - assert.equal(projectService.externalProjects[1].getProjectName(), p3.projectFileName); - - session.executeCommand({ - seq: 3, - type: "request", - command: "openExternalProjects", - arguments: { projects: [] } - }); - checkNumberOfProjects(projectService, { externalProjects: 0 }); - - session.executeCommand({ - seq: 3, - type: "request", - command: "openExternalProjects", - arguments: { projects: [p2] } - }); - assert.equal(projectService.externalProjects[0].getProjectName(), p2.projectFileName); - }); + assert(!configFileName, `should not find config, got: '${configFileName}`); + checkNumberOfConfiguredProjects(projectService, 0); + checkNumberOfInferredProjects(projectService, 1); - it("handle recreated files correctly", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{}` - }; - const host = createServerHost([commonFile1, commonFile2, configFile]); - const projectService = createProjectService(host); - projectService.openClientFile(commonFile1.path); - - checkNumberOfConfiguredProjects(projectService, 1); - const project = configuredProjectAt(projectService, 0); - checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); - - // delete commonFile2 - host.reloadFS([commonFile1, configFile]); - host.checkTimeoutQueueLengthAndRun(2); - checkProjectRootFiles(project, [commonFile1.path]); - - // re-add commonFile2 - host.reloadFS([commonFile1, commonFile2, configFile]); - host.checkTimeoutQueueLengthAndRun(2); - checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); - }); + const project = projectService.inferredProjects[0]; - it("handles the missing files - that were added to program because they were added with /// { - const file1: FileOrFolder = { - path: "/a/b/commonFile1.ts", - content: `/// - let x = y` - }; - const host = createServerHost([file1, libFile]); - const session = createSession(host); - openFilesForSession([file1], session); - const projectService = session.getProjectService(); - - checkNumberOfInferredProjects(projectService, 1); - const project = projectService.inferredProjects[0]; - checkProjectRootFiles(project, [file1.path]); - checkProjectActualFiles(project, [file1.path, libFile.path]); - const getErrRequest = makeSessionRequest( - server.CommandNames.SemanticDiagnosticsSync, - { file: file1.path } - ); - - // Two errors: CommonFile2 not found and cannot find name y - let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyDiagnostics(diags, [ - { diagnosticMessage: Diagnostics.Cannot_find_name_0, errorTextArguments: ["y"] }, - { diagnosticMessage: Diagnostics.File_0_not_found, errorTextArguments: [commonFile2.path] } - ]); - - host.reloadFS([file1, commonFile2, libFile]); - host.runQueuedTimeoutCallbacks(); - checkNumberOfInferredProjects(projectService, 1); - assert.strictEqual(projectService.inferredProjects[0], project, "Inferred project should be same"); - checkProjectRootFiles(project, [file1.path]); - checkProjectActualFiles(project, [file1.path, libFile.path, commonFile2.path]); - diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; - verifyNoDiagnostics(diags); - }); + checkFileNames("inferred project", project.getFileNames(), ["/a/b/c/app.ts", fakes.FakeServerHost.libPath, "/a/b/c/module.d.ts"]); + const configFileLocations = ["/a/b/c/", "/a/b/", "/a/", "/"]; + const configFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]); + checkWatchedFiles(host, configFiles.concat(fakes.FakeServerHost.libPath, "/a/b/c/module.d.ts")); + checkWatchedDirectories(host, [], /*recursive*/ false); + checkWatchedDirectories(host, ["/a/b/c", combinePaths("/a/b/c/", nodeModulesAtTypes)], /*recursive*/ true); + }); - it("should create new inferred projects for files excluded from a configured project", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {}, - "files": ["${commonFile1.path}", "${commonFile2.path}"] - }` - }; - const files = [commonFile1, commonFile2, configFile]; - const host = createServerHost(files); - const projectService = createProjectService(host); - projectService.openClientFile(commonFile1.path); - - const project = configuredProjectAt(projectService, 0); - checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); - configFile.content = `{ - "compilerOptions": {}, - "files": ["${commonFile1.path}"] - }`; - host.reloadFS(files); - - checkNumberOfConfiguredProjects(projectService, 1); - checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); - host.checkTimeoutQueueLengthAndRun(2); // Update the configured project + refresh inferred projects - checkNumberOfConfiguredProjects(projectService, 1); - checkProjectRootFiles(project, [commonFile1.path]); - - projectService.openClientFile(commonFile2.path); - checkNumberOfInferredProjects(projectService, 1); - }); + it("can handle tsconfig file name with difference casing", () => { + const host = new fakes.FakeServerHost({ vfs: { useCaseSensitiveFileNames: false } }); + host.vfs.addFile("/a/b/app.ts", `let x = 1`); + host.vfs.addFile("/a/b/tsconfig.json", `{ "include": [] }`); - it("files explicitly excluded in config file", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": {}, - "exclude": ["/a/c"] - }` - }; - const excludedFile1: FileOrFolder = { - path: "/a/c/excluedFile1.ts", - content: `let t = 1;` - }; + const service = createProjectService(host); + service.openExternalProject({ + projectFileName: "/a/b/project.csproj", + rootFiles: toExternalFiles(["/a/b/app.ts", "/A/B/tsconfig.json"]), + options: {} + }); + service.checkNumberOfProjects({ configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(service, 0), ["/A/B/tsconfig.json"]); - const host = createServerHost([commonFile1, commonFile2, excludedFile1, configFile]); - const projectService = createProjectService(host); + service.openClientFile("/a/b/app.ts"); + service.checkNumberOfProjects({ configuredProjects: 1, inferredProjects: 1 }); - projectService.openClientFile(commonFile1.path); - checkNumberOfConfiguredProjects(projectService, 1); - const project = configuredProjectAt(projectService, 0); - checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); - projectService.openClientFile(excludedFile1.path); - checkNumberOfInferredProjects(projectService, 1); - }); + checkProjectActualFiles(configuredProjectAt(service, 0), ["/A/B/tsconfig.json"]); + checkProjectActualFiles(service.inferredProjects[0], ["/a/b/app.ts"]); + }); - it("should properly handle module resolution changes in config file", () => { - const file1: FileOrFolder = { - path: "/a/b/file1.ts", - content: `import { T } from "module1";` - }; - const nodeModuleFile: FileOrFolder = { - path: "/a/b/node_modules/module1.ts", - content: `export interface T {}` - }; - const classicModuleFile: FileOrFolder = { - path: "/a/module1.ts", - content: `export interface T {}` - }; - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "moduleResolution": "node" - }, - "files": ["${file1.path}"] - }` - }; - const files = [file1, nodeModuleFile, classicModuleFile, configFile]; - const host = createServerHost(files); - const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - projectService.openClientFile(nodeModuleFile.path); - projectService.openClientFile(classicModuleFile.path); - - checkNumberOfConfiguredProjects(projectService, 1); - const project = configuredProjectAt(projectService, 0); - checkProjectActualFiles(project, [file1.path, nodeModuleFile.path, configFile.path]); - checkNumberOfInferredProjects(projectService, 1); - - configFile.content = `{ - "compilerOptions": { - "moduleResolution": "classic" - }, - "files": ["${file1.path}"] - }`; - host.reloadFS(files); - host.checkTimeoutQueueLengthAndRun(2); - checkProjectActualFiles(project, [file1.path, classicModuleFile.path, configFile.path]); - checkNumberOfInferredProjects(projectService, 1); - }); + it("create configured project without file list", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: ` + { + "compilerOptions": {}, + "exclude": [ + "e" + ] + }` + }; + const file1: FileOrFolder = { + path: "/a/b/c/f1.ts", + content: "let x = 1" + }; + const file2: FileOrFolder = { + path: "/a/b/d/f2.ts", + content: "let y = 1" + }; + const file3: FileOrFolder = { + path: "/a/b/e/f3.ts", + content: "let z = 1" + }; - it("should keep the configured project when the opened file is referenced by the project but not its root", () => { - const file1: FileOrFolder = { - path: "/a/b/main.ts", - content: "import { objA } from './obj-a';" - }; - const file2: FileOrFolder = { - path: "/a/b/obj-a.ts", - content: `export const objA = Object.assign({foo: "bar"}, {bar: "baz"});` - }; - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "target": "es6" - }, - "files": [ "main.ts" ] - }` - }; - const host = createServerHost([file1, file2, configFile]); - const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - projectService.closeClientFile(file1.path); - projectService.openClientFile(file2.path); - checkNumberOfConfiguredProjects(projectService, 1); - checkNumberOfInferredProjects(projectService, 0); - }); + const host = createServerHost([configFile, file1, file2, file3], { lib: true }); + const projectService = createProjectService(host); + const { configFileName, configFileErrors } = projectService.openClientFile(file1.path); - it("should keep the configured project when the opened file is referenced by the project but not its root", () => { - const file1: FileOrFolder = { - path: "/a/b/main.ts", - content: "import { objA } from './obj-a';" - }; - const file2: FileOrFolder = { - path: "/a/b/obj-a.ts", - content: `export const objA = Object.assign({foo: "bar"}, {bar: "baz"});` - }; - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "target": "es6" - }, - "files": [ "main.ts" ] - }` - }; - const host = createServerHost([file1, file2, configFile]); - const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - projectService.closeClientFile(file1.path); - projectService.openClientFile(file2.path); - checkNumberOfConfiguredProjects(projectService, 1); - checkNumberOfInferredProjects(projectService, 0); - }); - it("should tolerate config file errors and still try to build a project", () => { - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "target": "es6", - "allowAnything": true - }, - "someOtherProperty": {} - }` - }; - const host = createServerHost([commonFile1, commonFile2, libFile, configFile]); - const projectService = createProjectService(host); - projectService.openClientFile(commonFile1.path); - checkNumberOfConfiguredProjects(projectService, 1); - checkProjectRootFiles(configuredProjectAt(projectService, 0), [commonFile1.path, commonFile2.path]); - }); + assert(configFileName, "should find config file"); + assert.isTrue(!configFileErrors || configFileErrors.length === 0, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); + checkNumberOfInferredProjects(projectService, 0); + checkNumberOfConfiguredProjects(projectService, 1); - it("should disable features when the files are too large", () => { - const file1 = { - path: "/a/b/f1.js", - content: "let x =1;", - fileSize: 10 * 1024 * 1024 - }; - const file2 = { - path: "/a/b/f2.js", - content: "let y =1;", - fileSize: 6 * 1024 * 1024 - }; - const file3 = { - path: "/a/b/f3.js", - content: "let y =1;", - fileSize: 6 * 1024 * 1024 - }; + const project = configuredProjectAt(projectService, 0); + checkProjectActualFiles(project, [file1.path, fakes.FakeServerHost.libPath, file2.path, configFile.path]); + checkProjectRootFiles(project, [file1.path, file2.path]); + // watching all files except one that was open + checkWatchedFiles(host, [configFile.path, file2.path, fakes.FakeServerHost.libPath]); + const configFileDirectory = getDirectoryPath(configFile.path); + checkWatchedDirectories(host, [configFileDirectory, combinePaths(configFileDirectory, nodeModulesAtTypes)], /*recursive*/ true); + }); - const proj1name = "proj1", proj2name = "proj2", proj3name = "proj3"; + it("create configured project with the file list", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: ` + { + "compilerOptions": {}, + "include": ["*.ts"] + }` + }; + const file1: FileOrFolder = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2: FileOrFolder = { + path: "/a/b/f2.ts", + content: "let y = 1" + }; + const file3: FileOrFolder = { + path: "/a/b/c/f3.ts", + content: "let z = 1" + }; - const host = createServerHost([file1, file2, file3]); - const projectService = createProjectService(host); + const host = createServerHost([configFile, libFile, file1, file2, file3]); + const projectService = createProjectService(host); + const { configFileName, configFileErrors } = projectService.openClientFile(file1.path); - projectService.openExternalProject({ rootFiles: toExternalFiles([file1.path]), options: {}, projectFileName: proj1name }); - const proj1 = projectService.findProject(proj1name); - assert.isTrue(proj1.languageServiceEnabled); + assert(configFileName, "should find config file"); + assert.isTrue(!configFileErrors || configFileErrors.length === 0, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); + checkNumberOfInferredProjects(projectService, 0); + checkNumberOfConfiguredProjects(projectService, 1); - projectService.openExternalProject({ rootFiles: toExternalFiles([file2.path]), options: {}, projectFileName: proj2name }); - const proj2 = projectService.findProject(proj2name); - assert.isTrue(proj2.languageServiceEnabled); + const project = configuredProjectAt(projectService, 0); + checkProjectActualFiles(project, [file1.path, fakes.FakeServerHost.libPath, file2.path, configFile.path]); + checkProjectRootFiles(project, [file1.path, file2.path]); + // watching all files except one that was open + checkWatchedFiles(host, [configFile.path, file2.path, fakes.FakeServerHost.libPath]); + checkWatchedDirectories(host, [getDirectoryPath(configFile.path)], /*recursive*/ false); + }); - projectService.openExternalProject({ rootFiles: toExternalFiles([file3.path]), options: {}, projectFileName: proj3name }); - const proj3 = projectService.findProject(proj3name); - assert.isFalse(proj3.languageServiceEnabled); - }); + it("add and then remove a config file in a folder with loose files", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "files": ["commonFile1.ts"] + }` + }; + const filesWithoutConfig = [libFile, commonFile1, commonFile2]; + const host = createServerHost(filesWithoutConfig); - it("should use only one inferred project if 'useOneInferredProject' is set", () => { - const file1 = { - path: "/a/b/main.ts", - content: "let x =1;" - }; - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "target": "es6" - }, - "files": [ "main.ts" ] - }` - }; - const file2 = { - path: "/a/c/main.ts", - content: "let x =1;" - }; + // const filesWithConfig = [libFile, commonFile1, commonFile2, configFile]; + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + projectService.openClientFile(commonFile2.path); - const file3 = { - path: "/a/d/main.ts", - content: "let x =1;" - }; + checkNumberOfInferredProjects(projectService, 2); + const configFileLocations = ["/", "/a/", "/a/b/"]; + const watchedFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]).concat(fakes.FakeServerHost.libPath); + checkWatchedFiles(host, watchedFiles); - const host = createServerHost([file1, file2, file3, libFile]); - const projectService = createProjectService(host, { useSingleInferredProject: true }); - projectService.openClientFile(file1.path); - projectService.openClientFile(file2.path); - projectService.openClientFile(file3.path); + // Add a tsconfig file + host.vfs.addFile(configFile.path, configFile.content); + host.checkTimeoutQueueLengthAndRun(1); + checkNumberOfInferredProjects(projectService, 1); + checkNumberOfConfiguredProjects(projectService, 1); + checkWatchedFiles(host, watchedFiles); - checkNumberOfConfiguredProjects(projectService, 0); - checkNumberOfInferredProjects(projectService, 1); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path, libFile.path]); + // remove the tsconfig file + host.vfs.removeFile(configFile.path); + checkNumberOfInferredProjects(projectService, 1); + host.checkTimeoutQueueLengthAndRun(1); // Refresh inferred projects - host.reloadFS([file1, configFile, file2, file3, libFile]); - host.checkTimeoutQueueLengthAndRun(1); - checkNumberOfConfiguredProjects(projectService, 1); - checkNumberOfInferredProjects(projectService, 1); - checkProjectActualFiles(projectService.inferredProjects[0], [file2.path, file3.path, libFile.path]); - }); + checkNumberOfInferredProjects(projectService, 2); + checkNumberOfConfiguredProjects(projectService, 0); + checkWatchedFiles(host, watchedFiles); + }); - it("should reuse same project if file is opened from the configured project that has no open files", () => { - const file1 = { - path: "/a/b/main.ts", - content: "let x =1;" - }; - const file2 = { - path: "/a/b/main2.ts", - content: "let y =1;" - }; - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "target": "es6" - }, - "files": [ "main.ts", "main2.ts" ] - }` - }; - const host = createServerHost([file1, file2, configFile, libFile]); - const projectService = createProjectService(host, { useSingleInferredProject: true }); - projectService.openClientFile(file1.path); - checkNumberOfConfiguredProjects(projectService, 1); - const project = projectService.configuredProjects.get(configFile.path); - assert.isTrue(project.hasOpenRef()); // file1 - - projectService.closeClientFile(file1.path); - checkNumberOfConfiguredProjects(projectService, 1); - assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); - assert.isFalse(project.hasOpenRef()); // No open files - assert.isFalse(project.isClosed()); - - projectService.openClientFile(file2.path); - checkNumberOfConfiguredProjects(projectService, 1); - assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); - assert.isTrue(project.hasOpenRef()); // file2 - assert.isFalse(project.isClosed()); - }); + it("add new files to a configured project without file list", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{}` + }; + const host = createServerHost([commonFile1, libFile, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + const configFileDir = getDirectoryPath(configFile.path); + checkWatchedDirectories(host, [configFileDir, combinePaths(configFileDir, nodeModulesAtTypes)], /*recursive*/ true); + checkNumberOfConfiguredProjects(projectService, 1); - it("should not close configured project after closing last open file, but should be closed on next file open if its not the file from same project", () => { - const file1 = { - path: "/a/b/main.ts", - content: "let x =1;" - }; - const configFile: FileOrFolder = { - path: "/a/b/tsconfig.json", - content: `{ - "compilerOptions": { - "target": "es6" - }, - "files": [ "main.ts" ] - }` - }; - const host = createServerHost([file1, configFile, libFile]); - const projectService = createProjectService(host, { useSingleInferredProject: true }); - projectService.openClientFile(file1.path); - checkNumberOfConfiguredProjects(projectService, 1); - const project = projectService.configuredProjects.get(configFile.path); - assert.isTrue(project.hasOpenRef()); // file1 - - projectService.closeClientFile(file1.path); - checkNumberOfConfiguredProjects(projectService, 1); - assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); - assert.isFalse(project.hasOpenRef()); // No files - assert.isFalse(project.isClosed()); - - projectService.openClientFile(libFile.path); - checkNumberOfConfiguredProjects(projectService, 0); - assert.isFalse(project.hasOpenRef()); // No files + project closed - assert.isTrue(project.isClosed()); - }); + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path]); - it("should not close external project with no open files", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x =1;" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y =1;" - }; - const externalProjectName = "externalproject"; - const host = createServerHost([file1, file2]); - const projectService = createProjectService(host); - projectService.openExternalProject({ - rootFiles: toExternalFiles([file1.path, file2.path]), - options: {}, - projectFileName: externalProjectName - }); - - checkNumberOfExternalProjects(projectService, 1); - checkNumberOfInferredProjects(projectService, 0); - - // open client file - should not lead to creation of inferred project - projectService.openClientFile(file1.path, file1.content); - checkNumberOfExternalProjects(projectService, 1); - checkNumberOfInferredProjects(projectService, 0); - - // close client file - external project should still exists - projectService.closeClientFile(file1.path); - checkNumberOfExternalProjects(projectService, 1); - checkNumberOfInferredProjects(projectService, 0); - - projectService.closeExternalProject(externalProjectName); - checkNumberOfExternalProjects(projectService, 0); - checkNumberOfInferredProjects(projectService, 0); - }); + // add a new ts file + host.vfs.addFile(commonFile2.path, commonFile2.content); + host.checkTimeoutQueueLengthAndRun(2); + // project service waits for 250ms to update the project structure, therefore the assertion needs to wait longer. + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + }); - it("external project that included config files", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x =1;" - }; - const config1 = { - path: "/a/b/tsconfig.json", - content: JSON.stringify( - { - compilerOptions: {}, - files: ["f1.ts"] - } - ) - }; - const file2 = { - path: "/a/c/f2.ts", - content: "let y =1;" - }; - const config2 = { - path: "/a/c/tsconfig.json", - content: JSON.stringify( - { - compilerOptions: {}, - files: ["f2.ts"] - } - ) - }; - const file3 = { - path: "/a/d/f3.ts", - content: "let z =1;" - }; - const externalProjectName = "externalproject"; - const host = createServerHost([file1, file2, file3, config1, config2]); - const projectService = createProjectService(host); - projectService.openExternalProject({ - rootFiles: toExternalFiles([config1.path, config2.path, file3.path]), - options: {}, - projectFileName: externalProjectName - }); - - checkNumberOfProjects(projectService, { configuredProjects: 2 }); - const proj1 = projectService.configuredProjects.get(config1.path); - const proj2 = projectService.configuredProjects.get(config2.path); - assert.isDefined(proj1); - assert.isDefined(proj2); - - // open client file - should not lead to creation of inferred project - projectService.openClientFile(file1.path, file1.content); - checkNumberOfProjects(projectService, { configuredProjects: 2 }); - assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); - assert.strictEqual(projectService.configuredProjects.get(config2.path), proj2); - - projectService.openClientFile(file3.path, file3.content); - checkNumberOfProjects(projectService, { configuredProjects: 2, inferredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); - assert.strictEqual(projectService.configuredProjects.get(config2.path), proj2); - - projectService.closeExternalProject(externalProjectName); - // open file 'file1' from configured project keeps project alive - checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); - assert.isUndefined(projectService.configuredProjects.get(config2.path)); - - projectService.closeClientFile(file3.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); - assert.isUndefined(projectService.configuredProjects.get(config2.path)); - - projectService.closeClientFile(file1.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); - assert.isUndefined(projectService.configuredProjects.get(config2.path)); - - projectService.openClientFile(file2.path, file2.content); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.isUndefined(projectService.configuredProjects.get(config1.path)); - assert.isDefined(projectService.configuredProjects.get(config2.path)); + it("should ignore non-existing files specified in the config file", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {}, + "files": [ + "commonFile1.ts", + "commonFile3.ts" + ] + }` + }; + const host = createServerHost([commonFile1, commonFile2, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + projectService.openClientFile(commonFile2.path); - }); + checkNumberOfConfiguredProjects(projectService, 1); + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path]); + checkNumberOfInferredProjects(projectService, 1); + }); - it("reload regular file after closing", () => { - const f1 = { - path: "/a/b/app.ts", - content: "x." - }; - const f2 = { - path: "/a/b/lib.ts", - content: "let x: number;" - }; + it("remove not-listed external projects", () => { + const f1 = { + path: "/a/app.ts", + content: "let x = 1" + }; + const f2 = { + path: "/b/app.ts", + content: "let x = 1" + }; + const f3 = { + path: "/c/app.ts", + content: "let x = 1" + }; + const makeProject = (f: FileOrFolder) => ({ projectFileName: f.path + ".csproj", rootFiles: [toExternalFile(f.path)], options: {} }); + const p1 = makeProject(f1); + const p2 = makeProject(f2); + const p3 = makeProject(f3); + + const host = createServerHost([f1, f2, f3]); + const session = createSession(host); + + session.executeCommand({ + seq: 1, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p1, p2] } + }); - const host = createServerHost([f1, f2, libFile]); - const service = createProjectService(host); - service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: toExternalFiles([f1.path, f2.path]), options: {} }); + const projectService = session.getProjectService(); + checkNumberOfProjects(projectService, { externalProjects: 2 }); + assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName); + assert.equal(projectService.externalProjects[1].getProjectName(), p2.projectFileName); + + session.executeCommand({ + seq: 2, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p1, p3] } + }); + checkNumberOfProjects(projectService, { externalProjects: 2 }); + assert.equal(projectService.externalProjects[0].getProjectName(), p1.projectFileName); + assert.equal(projectService.externalProjects[1].getProjectName(), p3.projectFileName); + + session.executeCommand({ + seq: 3, + type: "request", + command: "openExternalProjects", + arguments: { projects: [] } + }); + checkNumberOfProjects(projectService, { externalProjects: 0 }); - service.openClientFile(f1.path); - service.openClientFile(f2.path, "let x: string"); + session.executeCommand({ + seq: 3, + type: "request", + command: "openExternalProjects", + arguments: { projects: [p2] } + }); + assert.equal(projectService.externalProjects[0].getProjectName(), p2.projectFileName); + }); - service.checkNumberOfProjects({ externalProjects: 1 }); - checkProjectActualFiles(service.externalProjects[0], [f1.path, f2.path, libFile.path]); + it("handle recreated files correctly", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{}` + }; + const host = createServerHost([commonFile1, commonFile2, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); - const completions1 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 2, { includeExternalModuleExports: false }); - // should contain completions for string - assert.isTrue(completions1.entries.some(e => e.name === "charAt"), "should contain 'charAt'"); - assert.isFalse(completions1.entries.some(e => e.name === "toExponential"), "should not contain 'toExponential'"); + checkNumberOfConfiguredProjects(projectService, 1); + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + + // delete commonFile2 + host.vfs.removeFile(commonFile2.path); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectRootFiles(project, [commonFile1.path]); + + // re-add commonFile2 + host.vfs.addFile(commonFile2.path, commonFile2.content); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + }); - service.closeClientFile(f2.path); - const completions2 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 2, { includeExternalModuleExports: false }); - // should contain completions for string - assert.isFalse(completions2.entries.some(e => e.name === "charAt"), "should not contain 'charAt'"); - assert.isTrue(completions2.entries.some(e => e.name === "toExponential"), "should contain 'toExponential'"); - }); + it("handles the missing files - that were added to program because they were added with /// { + const file1: FileOrFolder = { + path: "/a/b/commonFile1.ts", + content: `/// + let x = y` + }; + const host = createServerHost([file1, libFile]); + const session = createSession(host); + openFilesForSession([file1], session); + const projectService = session.getProjectService(); - it("clear mixed content file after closing", () => { - const f1 = { - path: "/a/b/app.ts", - content: " " - }; - const f2 = { - path: "/a/b/lib.html", - content: "" - }; + checkNumberOfInferredProjects(projectService, 1); + const project = projectService.inferredProjects[0]; + checkProjectRootFiles(project, [file1.path]); + checkProjectActualFiles(project, [file1.path, fakes.FakeServerHost.libPath]); + const getErrRequest = makeSessionRequest( + server.CommandNames.SemanticDiagnosticsSync, + { file: file1.path } + ); - const host = createServerHost([f1, f2, libFile]); - const service = createProjectService(host); - service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: [{ fileName: f1.path }, { fileName: f2.path, hasMixedContent: true }], options: {} }); + // Two errors: CommonFile2 not found and cannot find name y + let diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyDiagnostics(diags, [ + { diagnosticMessage: Diagnostics.Cannot_find_name_0, errorTextArguments: ["y"] }, + { diagnosticMessage: Diagnostics.File_0_not_found, errorTextArguments: [commonFile2.path] } + ]); - service.openClientFile(f1.path); - service.openClientFile(f2.path, "let somelongname: string"); + host.vfs.addFile(commonFile2.path, commonFile2.content); + host.runQueuedTimeoutCallbacks(); + checkNumberOfInferredProjects(projectService, 1); + assert.strictEqual(projectService.inferredProjects[0], project, "Inferred project should be same"); + checkProjectRootFiles(project, [file1.path]); + checkProjectActualFiles(project, [file1.path, fakes.FakeServerHost.libPath, commonFile2.path]); + diags = session.executeCommand(getErrRequest).response as server.protocol.Diagnostic[]; + verifyNoDiagnostics(diags); + }); - service.checkNumberOfProjects({ externalProjects: 1 }); - checkProjectActualFiles(service.externalProjects[0], [f1.path, f2.path, libFile.path]); + it("should create new inferred projects for files excluded from a configured project", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {}, + "files": ["${commonFile1.path}", "${commonFile2.path}"] + }` + }; + const files = [commonFile1, commonFile2, configFile]; + const host = createServerHost(files); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); - const completions1 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 0, { includeExternalModuleExports: false }); - assert.isTrue(completions1.entries.some(e => e.name === "somelongname"), "should contain 'somelongname'"); + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + configFile.content = `{ + "compilerOptions": {}, + "files": ["${commonFile1.path}"] + }`; + host.vfs.writeFile(configFile.path, configFile.content); - service.closeClientFile(f2.path); - const completions2 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 0, { includeExternalModuleExports: false }); - assert.isFalse(completions2.entries.some(e => e.name === "somelongname"), "should not contain 'somelongname'"); - const sf2 = service.externalProjects[0].getLanguageService().getProgram().getSourceFile(f2.path); - assert.equal(sf2.text, ""); - }); + checkNumberOfConfiguredProjects(projectService, 1); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + host.checkTimeoutQueueLengthAndRun(2); // Update the configured project + refresh inferred projects + checkNumberOfConfiguredProjects(projectService, 1); + checkProjectRootFiles(project, [commonFile1.path]); + projectService.openClientFile(commonFile2.path); + checkNumberOfInferredProjects(projectService, 1); + }); - it("external project with included config file opened after configured project", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {} }) - }; - const externalProjectName = "externalproject"; - const host = createServerHost([file1, configFile]); - const projectService = createProjectService(host); + it("files explicitly excluded in config file", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": {}, + "exclude": ["/a/c"] + }` + }; + const excludedFile1: FileOrFolder = { + path: "/a/c/excluedFile1.ts", + content: `let t = 1;` + }; - projectService.openClientFile(file1.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const host = createServerHost([commonFile1, commonFile2, excludedFile1, configFile]); + const projectService = createProjectService(host); - projectService.openExternalProject({ - rootFiles: toExternalFiles([configFile.path]), - options: {}, - projectFileName: externalProjectName + projectService.openClientFile(commonFile1.path); + checkNumberOfConfiguredProjects(projectService, 1); + const project = configuredProjectAt(projectService, 0); + checkProjectRootFiles(project, [commonFile1.path, commonFile2.path]); + projectService.openClientFile(excludedFile1.path); + checkNumberOfInferredProjects(projectService, 1); }); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); + it("should properly handle module resolution changes in config file", () => { + const file1: FileOrFolder = { + path: "/a/b/file1.ts", + content: `import { T } from "module1";` + }; + const nodeModuleFile: FileOrFolder = { + path: "/a/b/node_modules/module1.ts", + content: `export interface T {}` + }; + const classicModuleFile: FileOrFolder = { + path: "/a/module1.ts", + content: `export interface T {}` + }; + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "moduleResolution": "node" + }, + "files": ["${file1.path}"] + }` + }; + const files = [file1, nodeModuleFile, classicModuleFile, configFile]; + const host = createServerHost(files); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + projectService.openClientFile(nodeModuleFile.path); + projectService.openClientFile(classicModuleFile.path); - projectService.closeClientFile(file1.path); - // configured project is alive since it is opened as part of external project - checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkNumberOfConfiguredProjects(projectService, 1); + const project = configuredProjectAt(projectService, 0); + checkProjectActualFiles(project, [file1.path, nodeModuleFile.path, configFile.path]); + checkNumberOfInferredProjects(projectService, 1); - projectService.closeExternalProject(externalProjectName); - checkNumberOfProjects(projectService, { configuredProjects: 0 }); - }); + configFile.content = `{ + "compilerOptions": { + "moduleResolution": "classic" + }, + "files": ["${file1.path}"] + }`; + host.vfs.writeFile(configFile.path, configFile.content); + host.checkTimeoutQueueLengthAndRun(2); + checkProjectActualFiles(project, [file1.path, classicModuleFile.path, configFile.path]); + checkNumberOfInferredProjects(projectService, 1); + }); - it("external project with included config file opened after configured project and then closed", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const file2 = { - path: "/a/f2.ts", - content: "let x = 1" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {} }) - }; - const externalProjectName = "externalproject"; - const host = createServerHost([file1, file2, libFile, configFile]); - const projectService = createProjectService(host); - - projectService.openClientFile(file1.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - const project = projectService.configuredProjects.get(configFile.path); + it("should keep the configured project when the opened file is referenced by the project but not its root", () => { + const file1: FileOrFolder = { + path: "/a/b/main.ts", + content: "import { objA } from './obj-a';" + }; + const file2: FileOrFolder = { + path: "/a/b/obj-a.ts", + content: `export const objA = Object.assign({foo: "bar"}, {bar: "baz"});` + }; + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts" ] + }` + }; + const host = createServerHost([file1, file2, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + projectService.closeClientFile(file1.path); + projectService.openClientFile(file2.path); + checkNumberOfConfiguredProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); + }); - projectService.openExternalProject({ - rootFiles: toExternalFiles([configFile.path]), - options: {}, - projectFileName: externalProjectName + it("should keep the configured project when the opened file is referenced by the project but not its root", () => { + const file1: FileOrFolder = { + path: "/a/b/main.ts", + content: "import { objA } from './obj-a';" + }; + const file2: FileOrFolder = { + path: "/a/b/obj-a.ts", + content: `export const objA = Object.assign({foo: "bar"}, {bar: "baz"});` + }; + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts" ] + }` + }; + const host = createServerHost([file1, file2, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + projectService.closeClientFile(file1.path); + projectService.openClientFile(file2.path); + checkNumberOfConfiguredProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); + }); + it("should tolerate config file errors and still try to build a project", () => { + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6", + "allowAnything": true + }, + "someOtherProperty": {} + }` + }; + const host = createServerHost([commonFile1, commonFile2, libFile, configFile]); + const projectService = createProjectService(host); + projectService.openClientFile(commonFile1.path); + checkNumberOfConfiguredProjects(projectService, 1); + checkProjectRootFiles(configuredProjectAt(projectService, 0), [commonFile1.path, commonFile2.path]); }); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + it("should disable features when the files are too large", () => { + const file1 = { + path: "/a/b/f1.js", + content: "let x =1;", + fileSize: 10 * 1024 * 1024 + }; + const file2 = { + path: "/a/b/f2.js", + content: "let y =1;", + fileSize: 6 * 1024 * 1024 + }; + const file3 = { + path: "/a/b/f3.js", + content: "let y =1;", + fileSize: 6 * 1024 * 1024 + }; - projectService.closeExternalProject(externalProjectName); - // configured project is alive since file is still open - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + const proj1name = "proj1", proj2name = "proj2", proj3name = "proj3"; - projectService.closeClientFile(file1.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + const host = createServerHost([file1, file2, file3]); + const getFileSizeSpy = spy(host, "getFileSize") + .setup(_ => _(file1.path), { return: file1.fileSize }) + .setup(_ => _(file2.path), { return: file2.fileSize }) + .setup(_ => _(file3.path), { return: file3.fileSize }); - projectService.openClientFile(file2.path); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - assert.isUndefined(projectService.configuredProjects.get(configFile.path)); - }); + const projectService = createProjectService(host); - it("changes in closed files are reflected in project structure", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export * from "./f2"` - }; - const file2 = { - path: "/a/b/f2.ts", - content: `export let x = 1` - }; - const file3 = { - path: "/a/c/f3.ts", - content: `export let y = 1;` - }; - const host = createServerHost([file1, file2, file3]); - const projectService = createProjectService(host); + projectService.openExternalProject({ rootFiles: toExternalFiles([file1.path]), options: {}, projectFileName: proj1name }); + const proj1 = projectService.findProject(proj1name); + assert.isTrue(proj1.languageServiceEnabled); - projectService.openClientFile(file1.path); + projectService.openExternalProject({ rootFiles: toExternalFiles([file2.path]), options: {}, projectFileName: proj2name }); + const proj2 = projectService.findProject(proj2name); + assert.isTrue(proj2.languageServiceEnabled); - checkNumberOfInferredProjects(projectService, 1); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path]); + projectService.openExternalProject({ rootFiles: toExternalFiles([file3.path]), options: {}, projectFileName: proj3name }); + const proj3 = projectService.findProject(proj3name); + assert.isFalse(proj3.languageServiceEnabled); - projectService.openClientFile(file3.path); - checkNumberOfInferredProjects(projectService, 2); - checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); + getFileSizeSpy.revoke(); + }); - const modifiedFile2 = { - path: file2.path, - content: `export * from "../c/f3"` // now inferred project should inclule file3 - }; + it("should use only one inferred project if 'useOneInferredProject' is set", () => { + const file1 = { + path: "/a/b/main.ts", + content: "let x =1;" + }; + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts" ] + }` + }; + const file2 = { + path: "/a/c/main.ts", + content: "let x =1;" + }; - host.reloadFS([file1, modifiedFile2, file3]); - host.checkTimeoutQueueLengthAndRun(2); - checkNumberOfInferredProjects(projectService, 1); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, modifiedFile2.path, file3.path]); - }); + const file3 = { + path: "/a/d/main.ts", + content: "let x =1;" + }; - it("deleted files affect project structure", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export * from "./f2"` - }; - const file2 = { - path: "/a/b/f2.ts", - content: `export * from "../c/f3"` - }; - const file3 = { - path: "/a/c/f3.ts", - content: `export let y = 1;` - }; - const host = createServerHost([file1, file2, file3]); - const projectService = createProjectService(host); + const host = createServerHost([file1, file2, file3, libFile]); + const projectService = createProjectService(host, { useSingleInferredProject: true }); + projectService.openClientFile(file1.path); + projectService.openClientFile(file2.path); + projectService.openClientFile(file3.path); - projectService.openClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 0); + checkNumberOfInferredProjects(projectService, 1); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path, fakes.FakeServerHost.libPath]); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path]); + host.vfs.writeFile(configFile.path, configFile.content); + host.checkTimeoutQueueLengthAndRun(1); + checkNumberOfConfiguredProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 1); + checkProjectActualFiles(projectService.inferredProjects[0], [file2.path, file3.path, fakes.FakeServerHost.libPath]); + }); - projectService.openClientFile(file3.path); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); + it("should reuse same project if file is opened from the configured project that has no open files", () => { + const file1 = { + path: "/a/b/main.ts", + content: "let x =1;" + }; + const file2 = { + path: "/a/b/main2.ts", + content: "let y =1;" + }; + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts", "main2.ts" ] + }` + }; + const host = createServerHost([file1, file2, configFile, libFile]); + const projectService = createProjectService(host, { useSingleInferredProject: true }); + projectService.openClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 1); + const project = projectService.configuredProjects.get(configFile.path); + assert.isTrue(project.hasOpenRef()); // file1 - host.reloadFS([file1, file3]); - host.checkTimeoutQueueLengthAndRun(2); + projectService.closeClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + assert.isFalse(project.hasOpenRef()); // No open files + assert.isFalse(project.isClosed()); - checkNumberOfProjects(projectService, { inferredProjects: 2 }); + projectService.openClientFile(file2.path); + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + assert.isTrue(project.hasOpenRef()); // file2 + assert.isFalse(project.isClosed()); + }); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); - checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); - }); + it("should not close configured project after closing last open file, but should be closed on next file open if its not the file from same project", () => { + const file1 = { + path: "/a/b/main.ts", + content: "let x =1;" + }; + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "target": "es6" + }, + "files": [ "main.ts" ] + }` + }; + const host = createServerHost([file1, configFile, libFile]); + const projectService = createProjectService(host, { useSingleInferredProject: true }); + projectService.openClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 1); + const project = projectService.configuredProjects.get(configFile.path); + assert.isTrue(project.hasOpenRef()); // file1 - it("ignores files excluded by a custom safe type list", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "export let x = 5" - }; - const office = { - path: "/lib/duckquack-3.min.js", - content: "whoa do @@ not parse me ok thanks!!!" - }; - const host = createServerHost([file1, office, customTypesMap]); - const projectService = createProjectService(host); - try { - projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, office.path]) }); - const proj = projectService.externalProjects[0]; - assert.deepEqual(proj.getFileNames(/*excludeFilesFromExternalLibraries*/ true), [file1.path]); - assert.deepEqual(proj.getTypeAcquisition().include, ["duck-types"]); - } finally { - projectService.resetSafeList(); - } - }); + projectService.closeClientFile(file1.path); + checkNumberOfConfiguredProjects(projectService, 1); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); + assert.isFalse(project.hasOpenRef()); // No files + assert.isFalse(project.isClosed()); + + projectService.openClientFile(fakes.FakeServerHost.libPath); + checkNumberOfConfiguredProjects(projectService, 0); + assert.isFalse(project.hasOpenRef()); // No files + project closed + assert.isTrue(project.isClosed()); + }); - it("ignores files excluded by the default type list", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "export let x = 5" - }; - const minFile = { - path: "/c/moment.min.js", - content: "unspecified" - }; - const kendoFile1 = { - path: "/q/lib/kendo/kendo.all.min.js", - content: "unspecified" - }; - const kendoFile2 = { - path: "/q/lib/kendo/kendo.ui.min.js", - content: "unspecified" - }; - const officeFile1 = { - path: "/scripts/Office/1/excel-15.debug.js", - content: "unspecified" - }; - const officeFile2 = { - path: "/scripts/Office/1/powerpoint.js", - content: "unspecified" - }; - const files = [file1, minFile, kendoFile1, kendoFile2, officeFile1, officeFile2]; - const host = createServerHost(files); - const projectService = createProjectService(host); - try { - projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles(files.map(f => f.path)) }); - const proj = projectService.externalProjects[0]; - assert.deepEqual(proj.getFileNames(/*excludeFilesFromExternalLibraries*/ true), [file1.path]); - assert.deepEqual(proj.getTypeAcquisition().include, ["kendo-ui", "office"]); - } finally { - projectService.resetSafeList(); - } - }); + it("should not close external project with no open files", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x =1;" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y =1;" + }; + const externalProjectName = "externalproject"; + const host = createServerHost([file1, file2]); + const projectService = createProjectService(host); + projectService.openExternalProject({ + rootFiles: toExternalFiles([file1.path, file2.path]), + options: {}, + projectFileName: externalProjectName + }); - it("removes version numbers correctly", () => { - const testData: [string, string][] = [ - ["jquery-max", "jquery-max"], - ["jquery.min", "jquery"], - ["jquery-min.4.2.3", "jquery"], - ["jquery.min.4.2.1", "jquery"], - ["minimum", "minimum"], - ["min", "min"], - ["min.3.2", "min"], - ["jquery", "jquery"] - ]; - for (const t of testData) { - assert.equal(removeMinAndVersionNumbers(t[0]), t[1], t[0]); - } - }); + checkNumberOfExternalProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); - it("ignores files excluded by a legacy safe type list", () => { - const file1 = { - path: "/a/b/bliss.js", - content: "let x = 5" - }; - const file2 = { - path: "/a/b/foo.js", - content: "" - }; - const host = createServerHost([file1, file2, customTypesMap]); - const projectService = createProjectService(host); - try { - projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, file2.path]), typeAcquisition: { enable: true } }); - const proj = projectService.externalProjects[0]; - assert.deepEqual(proj.getFileNames(), [file2.path]); - } finally { - projectService.resetSafeList(); - } - }); + // open client file - should not lead to creation of inferred project + projectService.openClientFile(file1.path, file1.content); + checkNumberOfExternalProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); - it("open file become a part of configured project if it is referenced from root file", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "export let x = 5" - }; - const file2 = { - path: "/a/c/f2.ts", - content: `import {x} from "../b/f1"` - }; - const file3 = { - path: "/a/c/f3.ts", - content: "export let y = 1" - }; - const configFile = { - path: "/a/c/tsconfig.json", - content: JSON.stringify({ compilerOptions: {}, files: ["f2.ts", "f3.ts"] }) - }; + // close client file - external project should still exists + projectService.closeClientFile(file1.path); + checkNumberOfExternalProjects(projectService, 1); + checkNumberOfInferredProjects(projectService, 0); - const host = createServerHost([file1, file2, file3]); - const projectService = createProjectService(host); + projectService.closeExternalProject(externalProjectName); + checkNumberOfExternalProjects(projectService, 0); + checkNumberOfInferredProjects(projectService, 0); + }); - projectService.openClientFile(file1.path); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); + it("external project that included config files", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x =1;" + }; + const config1 = { + path: "/a/b/tsconfig.json", + content: JSON.stringify( + { + compilerOptions: {}, + files: ["f1.ts"] + } + ) + }; + const file2 = { + path: "/a/c/f2.ts", + content: "let y =1;" + }; + const config2 = { + path: "/a/c/tsconfig.json", + content: JSON.stringify( + { + compilerOptions: {}, + files: ["f2.ts"] + } + ) + }; + const file3 = { + path: "/a/d/f3.ts", + content: "let z =1;" + }; + const externalProjectName = "externalproject"; + const host = createServerHost([file1, file2, file3, config1, config2]); + const projectService = createProjectService(host); + projectService.openExternalProject({ + rootFiles: toExternalFiles([config1.path, config2.path, file3.path]), + options: {}, + projectFileName: externalProjectName + }); - projectService.openClientFile(file3.path); - checkNumberOfProjects(projectService, { inferredProjects: 2 }); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); - checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); + checkNumberOfProjects(projectService, { configuredProjects: 2 }); + const proj1 = projectService.configuredProjects.get(config1.path); + const proj2 = projectService.configuredProjects.get(config2.path); + assert.isDefined(proj1); + assert.isDefined(proj2); + + // open client file - should not lead to creation of inferred project + projectService.openClientFile(file1.path, file1.content); + checkNumberOfProjects(projectService, { configuredProjects: 2 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.strictEqual(projectService.configuredProjects.get(config2.path), proj2); + + projectService.openClientFile(file3.path, file3.content); + checkNumberOfProjects(projectService, { configuredProjects: 2, inferredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.strictEqual(projectService.configuredProjects.get(config2.path), proj2); + + projectService.closeExternalProject(externalProjectName); + // open file 'file1' from configured project keeps project alive + checkNumberOfProjects(projectService, { configuredProjects: 1, inferredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.isUndefined(projectService.configuredProjects.get(config2.path)); + + projectService.closeClientFile(file3.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.isUndefined(projectService.configuredProjects.get(config2.path)); + + projectService.closeClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(config1.path), proj1); + assert.isUndefined(projectService.configuredProjects.get(config2.path)); + + projectService.openClientFile(file2.path, file2.content); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.isUndefined(projectService.configuredProjects.get(config1.path)); + assert.isDefined(projectService.configuredProjects.get(config2.path)); - host.reloadFS([file1, file2, file3, configFile]); - host.checkTimeoutQueueLengthAndRun(1); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, file3.path, configFile.path]); - }); + }); - it("correctly migrate files between projects", () => { - const file1 = { - path: "/a/b/f1.ts", - content: ` - export * from "../c/f2"; - export * from "../d/f3";` - }; - const file2 = { - path: "/a/c/f2.ts", - content: "export let x = 1;" - }; - const file3 = { - path: "/a/d/f3.ts", - content: "export let y = 1;" - }; - const host = createServerHost([file1, file2, file3]); - const projectService = createProjectService(host); + it("reload regular file after closing", () => { + const f1 = { + path: "/a/b/app.ts", + content: "x." + }; + const f2 = { + path: "/a/b/lib.ts", + content: "let x: number;" + }; - projectService.openClientFile(file2.path); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - checkProjectActualFiles(projectService.inferredProjects[0], [file2.path]); + const host = createServerHost([f1, f2, libFile]); + const service = createProjectService(host); + service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: toExternalFiles([f1.path, f2.path]), options: {} }); - projectService.openClientFile(file3.path); - checkNumberOfProjects(projectService, { inferredProjects: 2 }); - checkProjectActualFiles(projectService.inferredProjects[0], [file2.path]); - checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); + service.openClientFile(f1.path); + service.openClientFile(f2.path, "let x: string"); - projectService.openClientFile(file1.path); - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - checkProjectRootFiles(projectService.inferredProjects[0], [file1.path]); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path]); + service.checkNumberOfProjects({ externalProjects: 1 }); + checkProjectActualFiles(service.externalProjects[0], [f1.path, f2.path, fakes.FakeServerHost.libPath]); - projectService.closeClientFile(file1.path); - checkNumberOfProjects(projectService, { inferredProjects: 2 }); - }); + const completions1 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 2, { includeExternalModuleExports: false }); + // should contain completions for string + assert.isTrue(completions1.entries.some(e => e.name === "charAt"), "should contain 'charAt'"); + assert.isFalse(completions1.entries.some(e => e.name === "toExponential"), "should not contain 'toExponential'"); - it("can correctly update configured project when set of root files has changed (new file on disk)", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 1" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {} }) - }; + service.closeClientFile(f2.path); + const completions2 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 2, { includeExternalModuleExports: false }); + // should contain completions for string + assert.isFalse(completions2.entries.some(e => e.name === "charAt"), "should not contain 'charAt'"); + assert.isTrue(completions2.entries.some(e => e.name === "toExponential"), "should contain 'toExponential'"); + }); - const host = createServerHost([file1, configFile]); - const projectService = createProjectService(host); + it("clear mixed content file after closing", () => { + const f1 = { + path: "/a/b/app.ts", + content: " " + }; + const f2 = { + path: "/a/b/lib.html", + content: "" + }; - projectService.openClientFile(file1.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, configFile.path]); + const host = createServerHost([f1, f2, libFile]); + const service = createProjectService(host); + service.openExternalProject({ projectFileName: "/a/b/project", rootFiles: [{ fileName: f1.path }, { fileName: f2.path, hasMixedContent: true }], options: {} }); - host.reloadFS([file1, file2, configFile]); + service.openClientFile(f1.path); + service.openClientFile(f2.path, "let somelongname: string"); - host.checkTimeoutQueueLengthAndRun(2); + service.checkNumberOfProjects({ externalProjects: 1 }); + checkProjectActualFiles(service.externalProjects[0], [f1.path, f2.path, fakes.FakeServerHost.libPath]); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectRootFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path]); - }); + const completions1 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 0, { includeExternalModuleExports: false }); + assert.isTrue(completions1.entries.some(e => e.name === "somelongname"), "should contain 'somelongname'"); - it("can correctly update configured project when set of root files has changed (new file in list of files)", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 1" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts"] }) - }; + service.closeClientFile(f2.path); + const completions2 = service.externalProjects[0].getLanguageService().getCompletionsAtPosition(f1.path, 0, { includeExternalModuleExports: false }); + assert.isFalse(completions2.entries.some(e => e.name === "somelongname"), "should not contain 'somelongname'"); + const sf2 = service.externalProjects[0].getLanguageService().getProgram().getSourceFile(f2.path); + assert.equal(sf2.text, ""); + }); - const host = createServerHost([file1, file2, configFile]); - const projectService = createProjectService(host); - projectService.openClientFile(file1.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, configFile.path]); + it("external project with included config file opened after configured project", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {} }) + }; + const externalProjectName = "externalproject"; + const host = createServerHost([file1, configFile]); + const projectService = createProjectService(host); - const modifiedConfigFile = { - path: configFile.path, - content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] }) - }; + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); - host.reloadFS([file1, file2, modifiedConfigFile]); + projectService.openExternalProject({ + rootFiles: toExternalFiles([configFile.path]), + options: {}, + projectFileName: externalProjectName + }); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - host.checkTimeoutQueueLengthAndRun(2); - checkProjectRootFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path]); - }); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); - it("can update configured project when set of root files was not changed", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 1" - }; - const configFile = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] }) - }; + projectService.closeClientFile(file1.path); + // configured project is alive since it is opened as part of external project + checkNumberOfProjects(projectService, { configuredProjects: 1 }); - const host = createServerHost([file1, file2, configFile]); - const projectService = createProjectService(host); + projectService.closeExternalProject(externalProjectName); + checkNumberOfProjects(projectService, { configuredProjects: 0 }); + }); - projectService.openClientFile(file1.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, configFile.path]); + it("external project with included config file opened after configured project and then closed", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2 = { + path: "/a/f2.ts", + content: "let x = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {} }) + }; + const externalProjectName = "externalproject"; + const host = createServerHost([file1, file2, libFile, configFile]); + const projectService = createProjectService(host); - const modifiedConfigFile = { - path: configFile.path, - content: JSON.stringify({ compilerOptions: { outFile: "out.js" }, files: ["f1.ts", "f2.ts"] }) - }; + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const project = projectService.configuredProjects.get(configFile.path); - host.reloadFS([file1, file2, modifiedConfigFile]); + projectService.openExternalProject({ + rootFiles: toExternalFiles([configFile.path]), + options: {}, + projectFileName: externalProjectName + }); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectRootFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path]); - }); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); - it("can correctly update external project when set of root files has changed", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 1" - }; - const host = createServerHost([file1, file2]); - const projectService = createProjectService(host); + projectService.closeExternalProject(externalProjectName); + // configured project is alive since file is still open + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); - projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path]) }); - checkNumberOfProjects(projectService, { externalProjects: 1 }); - checkProjectActualFiles(projectService.externalProjects[0], [file1.path]); + projectService.closeClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + assert.strictEqual(projectService.configuredProjects.get(configFile.path), project); - projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, file2.path]) }); - checkNumberOfProjects(projectService, { externalProjects: 1 }); - checkProjectRootFiles(projectService.externalProjects[0], [file1.path, file2.path]); - }); + projectService.openClientFile(file2.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + assert.isUndefined(projectService.configuredProjects.get(configFile.path)); + }); - it("can update external project when set of root files was not changed", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `export * from "m"` - }; - const file2 = { - path: "/a/b/f2.ts", - content: "export let y = 1" - }; - const file3 = { - path: "/a/m.ts", - content: "export let y = 1" - }; + it("changes in closed files are reflected in project structure", () => { + const file1 = { + path: "/a/b/f1.ts", + content: `export * from "./f2"` + }; + const file2 = { + path: "/a/b/f2.ts", + content: `export let x = 1` + }; + const file3 = { + path: "/a/c/f3.ts", + content: `export let y = 1;` + }; + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); - const host = createServerHost([file1, file2, file3]); - const projectService = createProjectService(host); + projectService.openClientFile(file1.path); - projectService.openExternalProject({ projectFileName: "project", options: { moduleResolution: ModuleResolutionKind.NodeJs }, rootFiles: toExternalFiles([file1.path, file2.path]) }); - checkNumberOfProjects(projectService, { externalProjects: 1 }); - checkProjectRootFiles(projectService.externalProjects[0], [file1.path, file2.path]); - checkProjectActualFiles(projectService.externalProjects[0], [file1.path, file2.path]); + checkNumberOfInferredProjects(projectService, 1); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path]); - projectService.openExternalProject({ projectFileName: "project", options: { moduleResolution: ModuleResolutionKind.Classic }, rootFiles: toExternalFiles([file1.path, file2.path]) }); - checkNumberOfProjects(projectService, { externalProjects: 1 }); - checkProjectRootFiles(projectService.externalProjects[0], [file1.path, file2.path]); - checkProjectActualFiles(projectService.externalProjects[0], [file1.path, file2.path, file3.path]); - }); + projectService.openClientFile(file3.path); + checkNumberOfInferredProjects(projectService, 2); + checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); - it("regression test for crash in acquireOrUpdateDocument", () => { - const tsFile = { - fileName: "/a/b/file1.ts", - path: "/a/b/file1.ts", - content: "" - }; - const jsFile = { - path: "/a/b/file1.js", - content: "var x = 10;", - fileName: "/a/b/file1.js", - scriptKind: "JS" as "JS" - }; + const modifiedFile2 = { + path: file2.path, + content: `export * from "../c/f3"` // now inferred project should inclule file3 + }; - const host = createServerHost([]); - const projectService = createProjectService(host); - projectService.applyChangesInOpenFiles([tsFile], [], []); - const projs = projectService.synchronizeProjectList([]); - projectService.findProject(projs[0].info.projectName).getLanguageService().getNavigationBarItems(tsFile.fileName); - projectService.synchronizeProjectList([projs[0].info]); - projectService.applyChangesInOpenFiles([jsFile], [], []); - }); + host.vfs.writeFile(modifiedFile2.path, modifiedFile2.content); + host.checkTimeoutQueueLengthAndRun(2); + checkNumberOfInferredProjects(projectService, 1); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, modifiedFile2.path, file3.path]); + }); - it("config file is deleted", () => { - const file1 = { - path: "/a/b/f1.ts", - content: "let x = 1;" - }; - const file2 = { - path: "/a/b/f2.ts", - content: "let y = 2;" - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: {} }) - }; - const host = createServerHost([file1, file2, config]); - const projectService = createProjectService(host); - - projectService.openClientFile(file1.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); - - projectService.openClientFile(file2.path); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); - - host.reloadFS([file1, file2]); - host.checkTimeoutQueueLengthAndRun(1); - checkNumberOfProjects(projectService, { inferredProjects: 2 }); - checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); - checkProjectActualFiles(projectService.inferredProjects[1], [file2.path]); - }); + it("deleted files affect project structure", () => { + const file1 = { + path: "/a/b/f1.ts", + content: `export * from "./f2"` + }; + const file2 = { + path: "/a/b/f2.ts", + content: `export * from "../c/f3"` + }; + const file3 = { + path: "/a/c/f3.ts", + content: `export let y = 1;` + }; + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); - it("loading files with correct priority", () => { - const f1 = { - path: "/a/main.ts", - content: "let x = 1" - }; - const f2 = { - path: "/a/main.js", - content: "var y = 1" - }; - const config = { - path: "/a/tsconfig.json", - content: JSON.stringify({ - compilerOptions: { allowJs: true } - }) - }; - const host = createServerHost([f1, f2, config]); - const projectService = createProjectService(host); - projectService.setHostConfiguration({ - extraFileExtensions: [ - { extension: ".js", isMixedContent: false }, - { extension: ".html", isMixedContent: true } - ] - }); - projectService.openClientFile(f1.path); - projectService.checkNumberOfProjects({ configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [f1.path, config.path]); - - // Should close configured project with next file open - projectService.closeClientFile(f1.path); - - projectService.openClientFile(f2.path); - projectService.checkNumberOfProjects({ inferredProjects: 1 }); - assert.isUndefined(projectService.configuredProjects.get(config.path)); - checkProjectActualFiles(projectService.inferredProjects[0], [f2.path]); - }); + projectService.openClientFile(file1.path); - it("tsconfig script block support", () => { - const file1 = { - path: "/a/b/f1.ts", - content: ` ` - }; - const file2 = { - path: "/a/b/f2.html", - content: `var hello = "hello";` - }; - const config = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { allowJs: true } }) - }; - const host = createServerHost([file1, file2, config]); - const session = createSession(host); - openFilesForSession([file1], session); - const projectService = session.getProjectService(); - - // HTML file will not be included in any projects yet - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - const configuredProj = configuredProjectAt(projectService, 0); - checkProjectActualFiles(configuredProj, [file1.path, config.path]); - - // Specify .html extension as mixed content - const extraFileExtensions = [{ extension: ".html", scriptKind: ScriptKind.JS, isMixedContent: true }]; - const configureHostRequest = makeSessionRequest(CommandNames.Configure, { extraFileExtensions }); - session.executeCommand(configureHostRequest); - - // The configured project should now be updated to include html file - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - assert.strictEqual(configuredProjectAt(projectService, 0), configuredProj, "Same configured project should be updated"); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); - - // Open HTML file - projectService.applyChangesInOpenFiles( - /*openFiles*/[{ fileName: file2.path, hasMixedContent: true, scriptKind: ScriptKind.JS, content: `var hello = "hello";` }], - /*changedFiles*/ undefined, - /*closedFiles*/ undefined); - - // Now HTML file is included in the project - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); - - // Check identifiers defined in HTML content are available in .ts file - const project = configuredProjectAt(projectService, 0); - let completions = project.getLanguageService().getCompletionsAtPosition(file1.path, 1, { includeExternalModuleExports: false }); - assert(completions && completions.entries[0].name === "hello", `expected entry hello to be in completion list`); - - // Close HTML file - projectService.applyChangesInOpenFiles( - /*openFiles*/ undefined, - /*changedFiles*/ undefined, - /*closedFiles*/[file2.path]); - - // HTML file is still included in project - checkNumberOfProjects(projectService, { configuredProjects: 1 }); - checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, config.path]); - - // Check identifiers defined in HTML content are not available in .ts file - completions = project.getLanguageService().getCompletionsAtPosition(file1.path, 5, { includeExternalModuleExports: false }); - assert(completions && completions.entries[0].name !== "hello", `unexpected hello entry in completion list`); - }); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); - it("no tsconfig script block diagnostic errors", () => { + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path]); - // #1. Ensure no diagnostic errors when allowJs is true - const file1 = { - path: "/a/b/f1.ts", - content: ` ` - }; - const file2 = { - path: "/a/b/f2.html", - content: `var hello = "hello";` - }; - const config1 = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { allowJs: true } }) - }; + projectService.openClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); - let host = createServerHost([file1, file2, config1, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); - let session = createSession(host); + host.vfs.removeFile(file2.path); + host.checkTimeoutQueueLengthAndRun(2); - // Specify .html extension as mixed content in a configure host request - const extraFileExtensions = [{ extension: ".html", scriptKind: ScriptKind.JS, isMixedContent: true }]; - const configureHostRequest = makeSessionRequest(CommandNames.Configure, { extraFileExtensions }); - session.executeCommand(configureHostRequest); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); - openFilesForSession([file1], session); - let projectService = session.getProjectService(); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); + }); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); + it("ignores files excluded by a custom safe type list", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "export let x = 5" + }; + const office = { + path: "/lib/duckquack-3.min.js", + content: "whoa do @@ not parse me ok thanks!!!" + }; + const host = createServerHost([file1, office, customTypesMap]); + const projectService = createProjectService(host); + try { + projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, office.path]) }); + const proj = projectService.externalProjects[0]; + assert.deepEqual(proj.getFileNames(/*excludeFilesFromExternalLibraries*/ true), [file1.path]); + assert.deepEqual(proj.getTypeAcquisition().include, ["duck-types"]); + } finally { + projectService.resetSafeList(); + } + }); - let diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); - assert.deepEqual(diagnostics, []); + it("ignores files excluded by the default type list", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "export let x = 5" + }; + const minFile = { + path: "/c/moment.min.js", + content: "unspecified" + }; + const kendoFile1 = { + path: "/q/lib/kendo/kendo.all.min.js", + content: "unspecified" + }; + const kendoFile2 = { + path: "/q/lib/kendo/kendo.ui.min.js", + content: "unspecified" + }; + const officeFile1 = { + path: "/scripts/Office/1/excel-15.debug.js", + content: "unspecified" + }; + const officeFile2 = { + path: "/scripts/Office/1/powerpoint.js", + content: "unspecified" + }; + const files = [file1, minFile, kendoFile1, kendoFile2, officeFile1, officeFile2]; + const host = createServerHost(files); + const projectService = createProjectService(host); + try { + projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles(files.map(f => f.path)) }); + const proj = projectService.externalProjects[0]; + assert.deepEqual(proj.getFileNames(/*excludeFilesFromExternalLibraries*/ true), [file1.path]); + assert.deepEqual(proj.getTypeAcquisition().include, ["kendo-ui", "office"]); + } finally { + projectService.resetSafeList(); + } + }); - // #2. Ensure no errors when allowJs is false - const config2 = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { allowJs: false } }) - }; + it("removes version numbers correctly", () => { + const testData: [string, string][] = [ + ["jquery-max", "jquery-max"], + ["jquery.min", "jquery"], + ["jquery-min.4.2.3", "jquery"], + ["jquery.min.4.2.1", "jquery"], + ["minimum", "minimum"], + ["min", "min"], + ["min.3.2", "min"], + ["jquery", "jquery"] + ]; + for (const t of testData) { + assert.equal(removeMinAndVersionNumbers(t[0]), t[1], t[0]); + } + }); - host = createServerHost([file1, file2, config2, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); - session = createSession(host); + it("ignores files excluded by a legacy safe type list", () => { + const file1 = { + path: "/a/b/bliss.js", + content: "let x = 5" + }; + const file2 = { + path: "/a/b/foo.js", + content: "" + }; + const host = createServerHost([file1, file2, customTypesMap]); + const projectService = createProjectService(host); + try { + projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles([file1.path, file2.path]), typeAcquisition: { enable: true } }); + const proj = projectService.externalProjects[0]; + assert.deepEqual(proj.getFileNames(), [file2.path]); + } finally { + projectService.resetSafeList(); + } + }); - session.executeCommand(configureHostRequest); + it("open file become a part of configured project if it is referenced from root file", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "export let x = 5" + }; + const file2 = { + path: "/a/c/f2.ts", + content: `import {x} from "../b/f1"` + }; + const file3 = { + path: "/a/c/f3.ts", + content: "export let y = 1" + }; + const configFile = { + path: "/a/c/tsconfig.json", + content: JSON.stringify({ compilerOptions: {}, files: ["f2.ts", "f3.ts"] }) + }; - openFilesForSession([file1], session); - projectService = session.getProjectService(); + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); - diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); - assert.deepEqual(diagnostics, []); + projectService.openClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); - // #3. Ensure no errors when compiler options aren't specified - const config3 = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({}) - }; + host.vfs.writeFile(configFile.path, configFile.content); + host.checkTimeoutQueueLengthAndRun(1); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path, file3.path, configFile.path]); + }); - host = createServerHost([file1, file2, config3, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); - session = createSession(host); + it("correctly migrate files between projects", () => { + const file1 = { + path: "/a/b/f1.ts", + content: ` + export * from "../c/f2"; + export * from "../d/f3";` + }; + const file2 = { + path: "/a/c/f2.ts", + content: "export let x = 1;" + }; + const file3 = { + path: "/a/d/f3.ts", + content: "export let y = 1;" + }; + const host = createServerHost([file1, file2, file3]); + const projectService = createProjectService(host); - session.executeCommand(configureHostRequest); + projectService.openClientFile(file2.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file2.path]); - openFilesForSession([file1], session); - projectService = session.getProjectService(); + projectService.openClientFile(file3.path); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + checkProjectActualFiles(projectService.inferredProjects[0], [file2.path]); + checkProjectActualFiles(projectService.inferredProjects[1], [file3.path]); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { inferredProjects: 1 }); + checkProjectRootFiles(projectService.inferredProjects[0], [file1.path]); + checkProjectActualFiles(projectService.inferredProjects[0], [file1.path, file2.path, file3.path]); - diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); - assert.deepEqual(diagnostics, []); + projectService.closeClientFile(file1.path); + checkNumberOfProjects(projectService, { inferredProjects: 2 }); + }); - // #4. Ensure no errors when files are explicitly specified in tsconfig - const config4 = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { allowJs: true }, files: [file1.path, file2.path] }) - }; + it("can correctly update configured project when set of root files has changed (new file on disk)", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {} }) + }; - host = createServerHost([file1, file2, config4, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); - session = createSession(host); + const host = createServerHost([file1, configFile]); + const projectService = createProjectService(host); - session.executeCommand(configureHostRequest); + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, configFile.path]); - openFilesForSession([file1], session); - projectService = session.getProjectService(); + host.vfs.writeFile(file2.path, file2.content); - checkNumberOfProjects(projectService, { configuredProjects: 1 }); + host.checkTimeoutQueueLengthAndRun(2); - diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); - assert.deepEqual(diagnostics, []); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectRootFiles(configuredProjectAt(projectService, 0), [file1.path, file2.path]); + }); - // #4. Ensure no errors when files are explicitly excluded in tsconfig - const config5 = { - path: "/a/b/tsconfig.json", - content: JSON.stringify({ compilerOptions: { allowJs: true }, exclude: [file2.path] }) - }; + it("can correctly update configured project when set of root files has changed (new file in list of files)", () => { + const file1 = { + path: "/a/b/f1.ts", + content: "let x = 1" + }; + const file2 = { + path: "/a/b/f2.ts", + content: "let y = 1" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts"] }) + }; - host = createServerHost([file1, file2, config5, libFile], { executingFilePath: combinePaths(getDirectoryPath(libFile.path), "tsc.js") }); - session = createSession(host); + const host = createServerHost([file1, file2, configFile]); + const projectService = createProjectService(host); - session.executeCommand(configureHostRequest); + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + checkProjectActualFiles(configuredProjectAt(projectService, 0), [file1.path, configFile.path]); - openFilesForSession([file1], session); - projectService = session.getProjectService(); + const modifiedConfigFile = { + path: configFile.path, + content: JSON.stringify({ compilerOptions: {}, files: ["f1.ts", "f2.ts"] }) + }; - checkNumberOfProjects(projectService, { configuredProjects: 1 }); + host.vfs.writeFile(modifiedConfigFile.path, modifiedConfigFile.content); - diagnostics = configuredProjectAt(projectService, 0).getLanguageService().getCompilerOptionsDiagnostics(); - assert.deepEqual(diagnostics, []); - }); - - it("project structure update is deferred if files are not added\removed", () => { - const file1 = { - path: "/a/b/f1.ts", - content: `import {x} from "./f2"` - }; - const file2 = { - path: "/a/b/f2.ts", - content: "export let x = 1" - }; - const host = createServerHost([file1, file2]); - const projectService = createProjectService(host); - - projectService.openClientFile(file1.path); - projectService.openClientFile(file2.path); - - checkNumberOfProjects(projectService, { inferredProjects: 1 }); - projectService.applyChangesInOpenFiles( - /*openFiles*/ undefined, - /*changedFiles*/[{ fileName: file1.path, changes: [{ span: createTextSpan(0, file1.path.length), newText: "let y = 1" }] }], - /*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 }); - }); - - it("files with mixed content are handled correctly", () => { - const file1 = { - path: "/a/b/f1.html", - content: ` + - +